I used a RadGrid to add/update my data.
My grid is linked to an ObjectDataSource that provides me some methods for select, insert, update, delete.
The actions on the grid are available by a GridEditCommandColumn for editing and a GridButtonColumn for deleting.
My problem is about to allow the edition of only some lines of my grid (depending to business rules that I can define in the SelectMethod).
Is there a mean to hide the Edit Button depending on this data (like I can for example enable a RadComboBox in an EditItemTemplate by this way :
Enabled='<%# Eval("Enabled") %>') ?
I think use one of the following ways, but my attempts are not really good :
- use a GridButtonColumn, but that means that I must manage myself the behavior of this links in this column in edit mode (UpdateText, CancelText, ...)
- Use HTML (or Javascript ?) in the EditText of my GridEditCommandColumn to specify on the client side the Edit text to display (or not display in my case) depending on the "Editable" field returned by my SelectMethod.
Is it a good way to reach my goal ? Have you others ideas to solve my problem ?
Thank you in advance,
Christophe.