Disable button in datagird on condition

S

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
 
N

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)
 
E

Elton Wang

It seems good. But you should also include
ListItemType.AlternatingItem.

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
474,266
Messages
2,571,081
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top