3

I am populating a telerik:RadGrid from a DataTable. Each of the DataRows in the DataTable has a "readonly" column with a value of true or false.

The grid currently has a GridEditCommand column, and a GridButtonColumn that triggers the "Delete" command.

What I need is for rows that display records for which "readonly" is true to be read-only. I need the icon in the GridEditCommand column to be different, and for clicking it to bring up a view-details form, instead of an edit form. And I need the link in the "Delete" GridButtonColumn to be absent.

It looks like it'd be pretty straightforward to create a table that doesn't allow the user to edit or to delete records, but I need to be able to have some rows editable and some not.

Where should I start?

Jeff Dege
  • 11,190
  • 22
  • 96
  • 165

1 Answers1

2

This is possible; I'd recommend on the left, the image be a command button, and you trigger the right action depending on the selection you make in itemcommand event. To change the icon, you'd need to tap into the rowdatabound event and programmably change it. Now for showing view details, I don't know if the Telerik grid has something built-in for the read-only view; this may have to be programmably done with a control outside of the grid.

HTH.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • I had to play a bit, removing the delete control, changing the image and the tooltip for the editbutton, and then I had to make changes inside the user control that did the actual editing, as well. But I basically used the mechanism you described. – Jeff Dege Dec 28 '10 at 17:57