passing value datagrid

D

Donkey

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.
 
G

Guest

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
 
D

Donkey

thanks a lot for your quick response, i got it working with your help.

i really appreciate it;

Donkey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top