hide/show or enable/disable grid column in Edit mode

Is there a way to programmatically hide/show or disable/enable a specific grid column in edit mode?

Basically, I have a column that is a checkbox. Once the user has completed a certain task, I want to disable or hide the checkbox column in edit mode so that the value (True/False) is still displayed but going into edit mode, the checkbox will not be displayed/rendered.

Thanks.

Ivan


2 Replies

FS Fathima Shalini P Syncfusion Team December 31, 2007 01:06 PM UTC

Hi Ivan,

Thanks for your interest in Syncfusion Products.

It is possible to hide/show a particular column in Edit Mode in GridGroupingControl. The following code snippet is used to acheive this behaviour.


void GridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if (e.Action == CurrentRecordAction.BeginEditCalled)
{
this.GridGroupingControl1.TableDescriptor.VisibleColumns.Remove("EmployeeID");
}
if (e.Action == CurrentRecordAction.EndEditComplete)
{
this.GridGroupingControl1.TableDescriptor.VisibleColumns.Add("EmployeeID");
}
}


Please find the simple sample in the following link:

http://www.syncfusion.com/Support/user/uploads/TogglingDatasourceWithFilterBar_b09965ca.zip

Please let me know if any concerns.

Regard,
Fathima.



IS Ivan Siew December 31, 2007 06:33 PM UTC

Hi Fathima,

This solution worked for me.

Thanks.

Ivan


Loader.
Up arrow icon