Hi
I have a GridView that has a column with RepositoryItemCheckEdit as ColumnEdit. I want to disable this control for just one row. How can I do this? Any suggestions?
Hi
I have a GridView that has a column with RepositoryItemCheckEdit as ColumnEdit. I want to disable this control for just one row. How can I do this? Any suggestions?
Hi, in the class that inherits DataGridViewColum override method InitializeEditingControl it has parameter rowIndex the write something like this
this.DataGridView.EditingControl.Enbale = rowIndex != 3; // or the number you need
I have found a solution to the problem.
gridView1.CustomRowCellEditForEditing += OnCustomRowCellEditForEditing;
private void OnCustomRowCellEditForEditing(object sender, CustomRowCellEditEventArgs e)
{
if (e.Column.FieldName != "MyFieldName") return;
*code here*
e.RepositoryItem.ReadOnly = true;
}
you can make the editor read only by handling CustomRowCellEdit:
private void gridView1_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
{
if(code goes here)
e.RepositoryItem.ReadOnly = true;
}
you can also prevent the editor from being show by handling ShowingEditor:
private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
{
if (code goes here)
e.Cancel = true;
}