I have a WebDataGrid with the following columns: Service_Date and ApprovedIf in a record, the Approved field = 1, I don't want the user to be able to edit the Service_Date cell for that record...but only for that record. If in another record, the Approved field = 0, then I want the user to be able to edit the Service_Date cell for that record.In UltraWebGrid, it was so easy...I could simply do the following in the InitializeRow code: If e.Row.Cells.FromKey("Approved_Flag").Value = 1 Then 'checked e.Row.Cells.FromKey("Service_Date").AllowEditing = Infragistics.WebUI.UltraWebGrid.AllowEditing.No End IfCan you please give a specific example of how to do this?
This does seem to work, but the only thing left that would make this perfect is to only do this if the user is in a certain active directory group. When I was using the UltraWebGrid, I was able to use:If Page.User.IsInRole("App_AIM_Admin_Users") Thenallow editing of a specific cellElsedo not allow editing of a certain cellDo you know of a way to accomplish this while still using the javascript example you have written?
Sorry I didn't respond to this. I have been pulled off on another project. I haven't had a chance to get this working yet, but as soon as I can get back to it, I will.
Hi algunderson,
I'm following up to see if you have resolved your issue.
A possible approach would be to cancel EnteringEditMode client-side event for rows where Approved_Flag equals 1:
function EnteringEditModeHandler(sender, eventArgs) { var currentRow = eventArgs.getCell().get_row(); var approved = currentRow.get_cellByColumnKey("Approved_Flag").get_value(); if (approved == 1) { eventArgs.set_cancel(true); }}
If you have any questions, please let me know.