How do I disable a bound hyperlink in a datagrid?

  • Thread starter Thread starter Souri Challa
  • Start date Start date
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
 
In addition, be sure to check for the right listitemtype, e.g. "item" or
"alternatingitem".

Bill
 
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
 
Back
Top