AD
Administrator
Syncfusion Team
August 24, 2006 08:50 AM UTC
Hi Gert,
Instead of setting the Enabled property of the grid, you can handle the CurretCellActivating event to cancel the activates on current cell. Below is a code snippet.
bool isReadOnly = false;
private void EnabledButton4_Click(object sender, System.EventArgs e)
{
isReadOnly = !isReadOnly;
this.grid.CurrentCellActivating +=new GridCurrentCellActivatingEventHandler(grid_CurrentCellActivating);
this.grid.Selections.Clear();
}
private void grid_CurrentCellActivating(object sender, GridCurrentCellActivatingEventArgs e)
{ e.Cancel = isReadOnly; }
private void grid_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{e.Cancel = isReadOnly;}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ReadOnlyGrid_5b46d9aa.zip
Let me know if this helps.
Best Regards,
Haneef