473,811 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing value datagrid

Hi,

Despite the many examples i can't find the right way to pass a value of
a datagrid to another form. So could someone please explain me what i
am doing wrong.

so i have a datagrid with an invisible column and a templatecolumn with
which i want to pass the value of the first column.

<asp:BoundColum n DataField="Chec klijstID" ReadOnly="True"
Visible="false" />

<asp:TemplateCo lumn HeaderText="Che cklijst">
<itemtemplate >
<asp:HyperLin k id="AttachmentL ink" runat="server" Target="_blank"
DataNavigateUrl Field="Checklij stID"
NavigateUrl='<% # "Checklijst2.as px?id={1}" %>' >

<%#DataBinder.E val(Container.D ataItem,"Checkl ijst")%>

</asp:HyperLink>
</ItemTemplate>
</asp:TemplateCol umn>
i don't know what i have to change but now i pass always {1} and not
the value of the seleted row and column.

Feb 10 '06 #1
2 1678
Hi Donkey,

You can use HyperLinkColumn :

<asp:HyperLinkC olumn
HeaderText="Che cklijst"
DataNavigateUrl Field="Checklij stID"
DataNavigateUrl FormatString="C hecklijst2.aspx ?id={0}"
DataTextField=" ChecklijstID"
Target="_blank"/>

And, if Invisible BoundColumn is only for pass value to link, you don't need
it any more. HyperLinkColumn 's DataTextField is used to store the data.

HTH

Elton Wang
"Donkey" wrote:
Hi,

Despite the many examples i can't find the right way to pass a value of
a datagrid to another form. So could someone please explain me what i
am doing wrong.

so i have a datagrid with an invisible column and a templatecolumn with
which i want to pass the value of the first column.

<asp:BoundColum n DataField="Chec klijstID" ReadOnly="True"
Visible="false" />

<asp:TemplateCo lumn HeaderText="Che cklijst">
<itemtemplate >
<asp:HyperLin k id="AttachmentL ink" runat="server" Target="_blank"
DataNavigateUrl Field="Checklij stID"
NavigateUrl='<% # "Checklijst2.as px?id={1}" %>' >

<%#DataBinder.E val(Container.D ataItem,"Checkl ijst")%>

</asp:HyperLink>
</ItemTemplate>
</asp:TemplateCol umn>
i don't know what i have to change but now i pass always {1} and not
the value of the seleted row and column.

Feb 10 '06 #2
thanks a lot for your quick response, i got it working with your help.

i really appreciate it;

Donkey

Feb 11 '06 #3

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

Similar topics

11
3488
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and click a button to determine whether the zip code is unique. If the zip code is not unique, another form/dialog is displayed (fclsLookup) - lookup form/dialog. The zip code and zipid are both passed to the lookup form/dialog by reference. I...
8
4417
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and click a button to determine whether the zip code is unique. If the zip code is not unique, another form/dialog is displayed (fclsLookup) - lookup form/dialog. The zip code is passed to the lookup form/dialog by reference. I then load a...
5
1807
by: DC Gringo | last post by:
I've got a command button to submit a value from a dropdown list that should then filter a SELECT query. I'm simply appending a WHERE colx = <variableSelectedFromDropdownList>. How do I pass this value into the event handler? -- MY EVENT HANDLER Sub RunReport_OnClick(sender As Object, e As System.EventArgs) _sqlStmt = _sqlStmt & " AND colx = '<variableSelectedFromDropdownList>'"
7
3458
by: Cemal Karademir | last post by:
Hello, Please forgive my simple question, but i don't know the correct synatx. From the masterpage i want to put a text in an textbox and then select an item in the datagrid. I do know how to pass the items in the datagrid(e.g. PLU, description, etc.) to an other (detail)page, but i don't know the correct syntax of how to pass the textbox value to the detailpage. I have the following code:
0
1490
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data into a background thread and get other data out and also update the main thread on which the main form was created. It seems to work fine. The basic function of the app is cheesy, I didn't spend any time on exception handling. northwind.mdb...
2
1420
by: jonefer | last post by:
I'm using a Public variable that I set on one page so that it will be available for another page but, I know this isn't the way it should be done. Being an Access Developer, how would I do the same thing in ASP.NET as: opening a form and passing a value to OpenArgs so that the next form can access that value? Also, for using a selected value from a DataGrid, could someone please show me the convention (and steps - please?) for...
4
2768
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx to a stored procedure on the details2.aspx page. I can successfully pass the values from the listbox control to a
3
2223
by: amjad | last post by:
Hi i have a webpage which has datagrid with one column called customer ID.. that customer ID is hyperlink mean i a click that customer ID it open a web page and display that customer ID on that page. is it possible to exchange value between web pages like my code is <asp:DataGrid id="DataGrid1" runat="server" Height="114px" Width="320px" ShowFooter="True"> <Columns><asp:HyperLinkColumn DataNavigateUrlField="CustID"...
4
5941
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh them I just set their datasource. I am guessing this is probably what is causing the problem. Is there a better way to do this? Anyway this all works happily and things show up when the record already exists but I have 2 problems ; 1) When I add...
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.