473,549 Members | 4,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebControls.Dat aGrid

I have a HyperLinkColumn inside my Databound grid on a page, I have been
using the URL Field property set to a field name in my bound data, and then
using the URL Format String as dbClientconn.as px?searchID={0} and all works
perfectly, however I need to set this to have to fields values in the
string,
something like;

URL Field: ClientConnectio nField, ClientCustomerR efField
URL Format String: dbclientconn.as px?searchID={0} &custref={1}

However this does not work, it would appear you can only use one format
placing {0}. Can someone tell me if you can do it and how ?

Thanks

Martin
Nov 18 '05 #1
1 1809
You are correct.
You are limited to 1.
=============== =============== =============== ===============
Here is how I get around it:
=============== =============== =============== ===============
In my grid I use this:
=============== =============== =============== ===============
<asp:TemplateCo lumn SortExpression= "statustext " HeaderText="Sta tus">
<HeaderStyle HorizontalAlign ="Center"></HeaderStyle>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<asp:Hyperlin k id="hylStatus" runat="server"> </asp:Hyperlink>
</ItemTemplate>
</asp:TemplateCol umn>

=============== =============== =============== ===============
In my code behind I use this:

Private Sub dg_ItemDataBoun d(ByVal sender As System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles dg.ItemDataBoun d

If e.Item.ItemType = ListItemType.It em Or e.Item.ItemType =
ListItemType.Al ternatingItem Then

'need to take paging into account!
Dim mIndex As Integer = CType(sender, DataGrid).PageS ize *
CType(sender, DataGrid).Curre ntPageIndex + e.Item.ItemInde x

'set Status hyperlink
Dim oHylStatus As HyperLink = CType(e.Item.Fi ndControl("hylS tatus"),
HyperLink)

'hide the link if the Status is "xyz", otherwise show it:
If myBizObj(mIndex ).status = "xyz" Then
oHylStatus.Navi gateUrl = ""
Else
'custom javascript function for opening a new window.
oHylStatus.Navi gateUrl = "javascript:New Win('ViewStatus .aspx?Key=" &
myBizObj(mIndex ).key & "&Type=" & myBizObj(mIndex ).type &
"','MyStatus',0 ,0,640,480);"
End If

oHylStatus.Text = myBizObj(mIndex ).statustext
....
=============== =============== =============== ===============
--
Joe Fallon

"Martin Dew" <re************ ************@ad astra.co.uk> wrote in message
news:eQ******** ******@TK2MSFTN GP10.phx.gbl...
I have a HyperLinkColumn inside my Databound grid on a page, I have been
using the URL Field property set to a field name in my bound data, and then using the URL Format String as dbClientconn.as px?searchID={0} and all works perfectly, however I need to set this to have to fields values in the
string,
something like;

URL Field: ClientConnectio nField, ClientCustomerR efField
URL Format String: dbclientconn.as px?searchID={0} &custref={1}

However this does not work, it would appear you can only use one format
placing {0}. Can someone tell me if you can do it and how ?

Thanks

Martin

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5264
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table (table.ID is TestTable) On .aspx page: <HeaderTemplate> <asp:Table ID="TestTable" runat="Server" /> </HeaderTemplate>
0
314
by: Nuno Monteiro | last post by:
Hello! Anyone knows how to add scroll bars in WebControls.DataGrid? -- Cumprimentos, Nuno Monteiro nuno@rcsoft.pt RCSoft - Desenvolvimento de Software, Lda. Telef: 239708708 Fax: 239708701
0
305
by: Nuno Monteiro | last post by:
Hello! I'm using a WebControls.DataGrid and I wanna allowpaging to show several pagins with a NextPrev mode selection The Query returns 8 Rows but only shows 1 page with 5 rows, and the page count is 1. My code is
5
2587
by: martin | last post by:
Hi, I am using vb.net and visual studio 2003. I have dragged a table webcontrol onto the designer server and configured a few columns and cells in the editor for the table control. Next I wanted to do things like add textbox websever controls to the individual cells. However, the designer will not allow me to drag controls from the...
3
2779
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts:...
0
1491
by: I am Sam | last post by:
Ok whats wrong with my toolbar? When I debug I don't get an error message and the databinding is working correctly but the toolbar itself and the <iewc:ToolbarDropDownlist /> control isn't showing up all that is returned to the web page is the buttons text and the contents of the DropDownlist. What am I doing wrong here? Below is the...
7
1333
by: Roger Moore | last post by:
Hi all, I have a beginner's question: If webcontrols are rendered to suit different browsers using different HTML syntax for each, how can I create a unified CSS stylesheet to them (using the cssStyle attribute). What I say is that I need to know which HTML tag i'm applying the style to, in order to know which CSS styles are relevant...
0
2281
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True" HeaderText="ID"></asp:BoundColumn> <asp:TemplateColumn HeaderText="O"> <ItemTemplate> <asp:DropDownList id="cmbObdelaj" runat="server" AutoPostBack="True"...
0
3315
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True" HeaderText="ID"></asp:BoundColumn> <asp:TemplateColumn HeaderText="O"> <ItemTemplate> <asp:DropDownList id="cmbObdelaj" runat="server" AutoPostBack="True"...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7962
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7480
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7814
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.