How do I disable a bound hyperlink in a datagrid?

S

Souri Challa

Mark,

You should do this in the item bound event.

After evaluating for your condition,You can do some thing like..

WebControl cntl = (WebControl)e.item.findcontrol("BoundColumnId");
cntl.enabled = false;

Hope this helps.
-Souri
 
G

Guest

In addition, be sure to check for the right listitemtype, e.g. "item" or
"alternatingitem".

Bill
 
M

Mark

Hi all, I have a datagrid with a few bound columns.

I have one column where for each row, I would like to check a condition and
disable the individual hyperlink associated with the datarow if the
condition is met.

How can I do this in the codebehind when the datagrid is created? I have
been playing around with the ItemCreated and ItemDataBound events of the
datagrid but cannot quite nail it.

Thanks in advance
Mark
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top