hello,
in our RadGrid we use in-row editing. however, i need to make certain editable elements read-only (or disabled), depending on the value in another bound column. for example, if the value of the "Status" read-only GridBoundColumn is "Rejected", then i need to disable editing for the other editable GridCheckBoxColumn and GridDropDownColumn columns we have.
i think this may be done in the OnEditCommand handler...but I'm not sure what the syntax is. have checked the docs but didn't see it.
i determined i can use the item.Cells collection to get the Status column's string value, like so:
...or do i intercept this on the OnCreateColumnEditor="gridItems_CreateColumnEditor" or OnItemDataBound="gridItems_ItemDataBound" events/handlers?
thanks,
matt
in our RadGrid we use in-row editing. however, i need to make certain editable elements read-only (or disabled), depending on the value in another bound column. for example, if the value of the "Status" read-only GridBoundColumn is "Rejected", then i need to disable editing for the other editable GridCheckBoxColumn and GridDropDownColumn columns we have.
i think this may be done in the OnEditCommand handler...but I'm not sure what the syntax is. have checked the docs but didn't see it.
i determined i can use the item.Cells collection to get the Status column's string value, like so:
protected void gridItems_EditCommand(object source, GridCommandEventArgs e){ GridEditableItem editableItem = e.Item as GridEditableItem; string status = e.Item.Cells[6].Text; //i mapped this out, 6 is the Status column value. switch (status.ToLower()) { case "rejected": //TODO: disable the UI for editing my particular columns here: // GridCheckBoxColumn // GridDropDownColumn // GridTemplateColumn break; }}...or do i intercept this on the OnCreateColumnEditor="gridItems_CreateColumnEditor" or OnItemDataBound="gridItems_ItemDataBound" events/handlers?
thanks,
matt