473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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:BoundColumn DataField="ChecklijstID" ReadOnly="True"
Visible="false" />

<asp:TemplateColumn HeaderText="Checklijst">
<itemtemplate>
<asp:HyperLink id="AttachmentLink" runat="server" Target="_blank"
DataNavigateUrlField="ChecklijstID"
NavigateUrl='<%# "Checklijst2.aspx?id={1}" %>' >

<%#DataBinder.Eval(Container.DataItem,"Checklijst" )%>

</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
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 1663
Hi Donkey,

You can use HyperLinkColumn:

<asp:HyperLinkColumn
HeaderText="Checklijst"
DataNavigateUrlField="ChecklijstID"
DataNavigateUrlFormatString="Checklijst2.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:BoundColumn DataField="ChecklijstID" ReadOnly="True"
Visible="false" />

<asp:TemplateColumn HeaderText="Checklijst">
<itemtemplate>
<asp:HyperLink id="AttachmentLink" runat="server" Target="_blank"
DataNavigateUrlField="ChecklijstID"
NavigateUrl='<%# "Checklijst2.aspx?id={1}" %>' >

<%#DataBinder.Eval(Container.DataItem,"Checklijst" )%>

</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
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
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...
8
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...
5
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...
7
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...
0
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...
2
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...
4
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...
3
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...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.