Home All Groups Group Topic Archive Search About

Disable button in datagird on condition

Author
1 Mar 2005 2:41 PM
Simon Abolnar
I have web datagrid with button column (delete button). I would like to
disable buttons in some raws of datagrid, depending on condition.

How to do that?

Thanks for help!

Simon

Author
1 Mar 2005 5:17 PM
NotHelpful
How about :
1. add ItemDataBound event to your datagrid
2. inside this event check if e.Item.ItemType = ListItemType.Item
3. inside this IF you enable or disable your button e.Item.Cells(X).Enabled
= False/True (where X-column index)


Show quoteHide quote
"Simon Abolnar" wrote:

> I have web datagrid with button column (delete button). I would like to
> disable buttons in some raws of datagrid, depending on condition.
>
> How to do that?
>
> Thanks for help!
>
> Simon
>
>
>
Author
1 Mar 2005 6:31 PM
Elton Wang
It seems good. But you should also include
ListItemType.AlternatingItem.

Elton Wang

>-----Original Message-----
>How about :
>1. add ItemDataBound event to your datagrid
>2. inside this event check if e.Item.ItemType =
ListItemType.Item
>3. inside this IF you enable or disable your button
e.Item.Cells(X).Enabled
>= False/True (where X-column index)
>
>
>"Simon Abolnar" wrote:
>
>> I have web datagrid with button column (delete button).
I would like to
Show quoteHide quote
>> disable buttons in some raws of datagrid, depending on
condition.
>>
>> How to do that?
>>
>> Thanks for help!
>>
>> Simon
>>
>>
>>
>.
>