question

Hi 

I want to ask about Editing column (Editing Value) I used action "CurrentCellBeginEdit , CurrentCellEndEdit", but these action doesn't work for me?
Is there any example for editing column ?

and when I hide the header of column ,it still there a Height for the header could I hide the height of the header of column  

help me please!

thanks 



1 Reply

JA Jayaraman Ayyanar Syncfusion Team July 25, 2018 12:47 PM UTC

Hi Aman, 
  
CurrentCellBeginEdit and CurrentCellEndEdit events will get notified when you are entering edit mode and completing the editing.  
 
Refer the below code examples, and set AllowEditing property of datagrid as true.  
  
Code snippet 
dataGrid.CurrentCellBeginEdit += DataGrid_CurrentCellBeginEdit; 
dataGrid.CurrentCellEndEdit += DataGrid_CurrentCellEndEdit; 
  
private void DataGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs e) 
{ 
    // Editing prevented for the cell at RowColumnIndex(1,1). 
    if (e.RowColumnIndex == new Syncfusion.GridCommon.ScrollAxis.RowColumnIndex(1, 1)) 
        e.Cancel = true; 
} 
  
private void DataGrid_CurrentCellBeginEdit(object sender, GridCurrentCellBeginEditEventArgs e) 
{ 
    // Editing prevented for the cell at RowColumnIndex(2,2). 
    if (e.RowColumnIndex == new Syncfusion.GridCommon.ScrollAxis.RowColumnIndex(2, 2)) 
        e.Cancel = true; 
} 
  
You can hide the column header by setting the datagrid. HeaderRowHeight as 0 which would hide the column header. 
  
Code snippet 
SfDataGrid.HeaderRowHeight = 0; 
  
You can also refer our help documentation in the below link 
  
We have attached a prepared sample and you can download the same from the below link. 
  
Regards, 
Jayaraman. 


Loader.
Up arrow icon