Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Simple question

Reply
Thread Tools

Simple question

 
 
Gary
Guest
Posts: n/a
 
      08-19-2003
Hi,
I have 7 columns on my datagrid, out of which one column (Column No 1) is
hidden (which is containing User ID), and the Column No 3 is displaying user
Name.
Now I have given hyperlink on Column no 3 (i.e User Name) & I want to pick
up the data from Column no 1 (i.e User ID) when I click the hyperlink.

Please let me know how this can be done.

TIA,
Gary


 
Reply With Quote
 
 
 
 
ASP.NET
Guest
Posts: n/a
 
      08-19-2003
are you using the SelectedIndexChanged event? try something like this (C#):

int userID = (int) myDataGrid.DataKeys[myDataGrid.SelectedIndex];

This assumes you have set the DataKeyField property of your grid. Think of
DataKeys as your collection of IDs, one ID per row.

Regards,
Stephen

"Gary" <(E-Mail Removed)> wrote in message
news:eCUB$(E-Mail Removed)...
> Hi,
> I have 7 columns on my datagrid, out of which one column (Column No 1) is
> hidden (which is containing User ID), and the Column No 3 is displaying

user
> Name.
> Now I have given hyperlink on Column no 3 (i.e User Name) & I want to pick
> up the data from Column no 1 (i.e User ID) when I click the hyperlink.
>
> Please let me know how this can be done.
>
> TIA,
> Gary
>
>



 
Reply With Quote
 
 
 
 
Sonali.NET[MVP]
Guest
Posts: n/a
 
      08-19-2003
How does your HyperlinkColumn look like
In case its
<asp:HyperLinkColumn HeaderText="UserName" DataNavigateUrlField="ID"
DataNavigateUrlFormatString="link.aspx?ID={0}"
DataTextField="UserName"></asp:HyperLinkColumn>
</Columns>

You can give the DataNavigateURL Field as Column 1 and DataTextField as column 3
In case of retrieving it you can use
Request.QueryString("ID")




"Gary" <(E-Mail Removed)> wrote in message news:eCUB$(E-Mail Removed)...
> Hi,
> I have 7 columns on my datagrid, out of which one column (Column No 1) is
> hidden (which is containing User ID), and the Column No 3 is displaying user
> Name.
> Now I have given hyperlink on Column no 3 (i.e User Name) & I want to pick
> up the data from Column no 1 (i.e User ID) when I click the hyperlink.
>
> Please let me know how this can be done.
>
> TIA,
> Gary
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plz, a simple answer to a simple question about IP addresses MeekiMoo Computer Support 0 07-28-2009 08:10 AM
Simple region code question... simple answer?? joseph.greer@gmail.com DVD Video 7 01-26-2007 09:07 PM
Simple Question - Simple Answer? Daniel Frey XML 4 01-12-2005 04:25 PM
Re: Simple Simple question!!! Kevin Spencer ASP .Net 0 06-25-2004 05:25 PM
Re: Simple Simple question!!! ashelley@inlandkwpp.com ASP .Net 0 06-25-2004 04:18 PM



Advertisments