bound columns of a datagrid

S

Sabina

i have a datagrid with few bound columns.i want to make the first column
clickable.can i make a bound column clickable and write a handler for
that.if that is not possible what is the otherway of doing it.
when i click on the column i should be able to get the value of a hidden
column of the selected row and pass it on to another page.the key field
column is hidden.
thanks in advance
sabina
 
S

Sabina

i have tried using hyperlink column but the problem i faced there was it can
pass the hyperlinked columns value to the navigateurl page.what i need to
pass to the navigate url page is the value of a invisible column of the
clicked row.

thanks
sabina
 
E

Elton Wang

You can't directly get a value from invisible column after
postback. So either you get it from datagrid's underlying
data source (if you set P-Key column invisible, it is also
unavailable) or use HyperLinkColumn and in
datagrid_ItemDataBound event rebuild NavigateUrl with a
query string like

HyperLink link = (HyperLink)e.Item.Cells[colindex].Controls
[0];
link.NavigateUrl = url + "?id=" + dataFromHidenCol;

HTH

Elton Wang
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top