public FormTest() { InitializeComponent(); DataGrid.AutoGeneratingRelations += DataGrid_AutoGeneratingRelations; } private void DataGrid_AutoGeneratingRelations(object sender, AutoGeneratingRelationsEventArgs e) { e.GridViewDefinition.DataGrid.AllowEditing = false; e.GridViewDefinition.DataGrid.AutoGeneratingColumn += DataGrid_AutoGeneratingColumn; } private void DataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) { if (e.Column.MappingName == "Select" || e.Column.MappingName == "Process") { e.Column.AllowEditing = true; } } |
private void DataGrid_DetailsViewLoading(object sender, DetailsViewLoadingAndUnloadingEventArgs e) { DataGrid.DetailsViewDefinitions[0].DataGrid.AllowEditing = false; DataGrid.DetailsViewDefinitions[0].DataGrid.Columns["Select"].AllowEditing = true; DataGrid.DetailsViewDefinitions[0].DataGrid.Columns["Process"].AllowEditing = true; } |
Its stated on the guide for the DataGrid that the Columns AllowEditing as priority over the Grid AllowEditing but it seems it is not working or most likely Im doing something wrong.
Also tried to manipulate it on CurrentCellBeginEdit event but the column of type bit/boolean represented by checkbox dont trigger this event.
How would I go about making only some columns editable and others non editable?
S.No |
Queries |
Solutions | |
1
|
I want to be able to set some columns of the master details as editable and others as non-editable but I havent managed to do it. |
We have created bug report for the reported issue “Particular column does not editable when AllowEditing enabled for that column in MasterDetailsViewDataGrid”. We will fix this issue and provide you with patch on November 17, 2020. You can track the status of this report through the following feedback link, Feedback link: https://www.syncfusion.com/feedback/19402/particular-column-does-not-editable-when-allowediting-enabled-for-that-column-in Note: The provider feedback link is private, and you need to login to view this feedback. | |
2
|
Cant make some columns readonly and others editable (SfDataGrid Master Details)
|
Your requirement can be achieved by setting false value for the AllowFocus property in SfDataGrid. Please refer the below code,
For more information, please refer the below UG link,
| |
3
|
Checkbox column does not trigger the event CurrentCellBeginEdit (SfDataGrid Master Details)
|
When click the CheckBox Column does not trigger the CurrentCellBeginEdit event in SfDataGrid. This is the Behavior of our control. Your requirement can be achieved by using SfDataGrid.CellCheckBoxClick event in SfDataGrid.
For more information, please refer the below UG link,
UG Link: https://help.syncfusion.com/windowsforms/datagrid/columntypes#canceling-the-check-box-state-change
|