I render my controls in view only mode and on click of edit button they are enabled.
I recursively disable the controls on page load and then recursively enable them on edit button click.
something like :
public
void DisableEditableControls(ControlCollection controls)
{
Type[] interfaces;
{
Type t = control.GetType();
if
(t.Name == typeof(RadGrid).Name)
{
RadGrid radGrid = (RadGrid)control;
radGrid.MasterTableView.CommandItemDisplay =
GridCommandItemDisplay.None;
radGrid.Columns.FindByUniqueNameSafe(
"EditCommandColumn").Display = false;
radGrid.Columns.FindByUniqueNameSafe(
"DeleteColumn").Display = false;
DisableEditableControls(radGrid.Controls);
if (radGrid.MasterTableView.HasDetailTables)
{
foreach (GridTableView gtv in radGrid.MasterTableView.DetailTables)
{
gtv.CommandItemDisplay =
GridCommandItemDisplay.None;
gtv.Columns.FindByUniqueNameSafe(
"EditCommandColumn").Display = false;
gtv.Columns.FindByUniqueNameSafe(
"DeleteColumn").Display = false;
gtv.Columns.FindByUniqueNameSafe("SelectColumn").Display = false;
DisableEditableControls(gtv.Controls);
}
}
continue;
}
}
The problem I am facing is I have a client select(for multiple rows) column, and when my controls are enabled the checkboxes still show disabled.if I do any operation on the grid like a sort, the check box is enabled.
Why is this happening?
Please let me know what am I missing here?