Some qustions on selecting a row while clicking

Hello


I click or doubleclikc on my sfdatagrid but doubleclick and clcik event never fires?
Mode is 
Me.DgSfSelection.SelectionMode = Syncfusion.WinForms.DataGrid.Enums.GridSelectionMode.Single

is this normal?


I see that events DgSfSelection_CellDoubleClick is fired but how can i get the cell.mappingname in this event ?


Thanks
Wheel

4 Replies

ER Eren June 8, 2018 05:37 PM UTC

 e.DataColumn.GridColumn.MappingName this should be work


MA Mohanram Anbukkarasu Syncfusion Team June 11, 2018 11:25 AM UTC

Hi Chris,   
  
Thanks for contacting Syncfusion support.   
   
Query   
Response   
Firing Click and DoubleClick events   
We have host the TableControl into SfDataGrid. So, you have to raise the Click or DoubleClick event for SfDataGrid.TableControl instead of SfDataGrid. Please refer the below code example.   
  
Code Example   
sfDataGrid.TableControl.Click += TableControl_Click;   
void TableControl_Click(object sender, System.EventArgs e)   
{   
    //Do your customizations here   
}   
   
sfDataGrid.TableControl.DoubleClick += TableControl_DoubleClick;   
void TableControl_DoubleClick(object sender, System.EventArgs e)   
{   
    //Do your customizations here   
}   
   
Note: You have to trigger the control events from SfDataGrid.TableControl instead of SfDataGrid.   
Getting the mapping name in CellDoubleCick event   
You can get the mapping name of the cell in the CellDoubleClick event as suggested by Eren. Please refer the below code example.   
  
Code Example   
sfDataGrid.CellDoubleClick += sfDataGrid_CellDoubleClick;   
   
void sfDataGrid_CellDoubleClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)   
{   
    var mappingName = e.DataColumn.GridColumn.MappingName;   
}   
   
   
   
 
Regards,   
Mohanram A.   



CV Chris Vandewiele June 11, 2018 11:53 AM UTC

Hello

Thanks for the clear answer

Wheel


MA Mohanram Anbukkarasu Syncfusion Team June 12, 2018 06:13 AM UTC

Hi Chris,  
 
Thanks for your update. 
 
We are glad to know that the given solution has solved your query. Please let us know, If you need any further assistance. 
 
Regards, 
Mohanram A. 


Loader.
Up arrow icon