Hi Murad Jafarov,
You cannot handle the Key and Mouse events of the SfDataGrid when raising them,
because the TableControl is hosted in the SfDataGrid. So, raise the
events for SfDataGrid.TableControl. Please refer to the below code
snippet,
|
//Event subscription sfDataGrid1.TableControl.MouseClick += OnMouseClick; sfDataGrid1.TableControl.MouseDoubleClick += OnMouseDoubleClick;
//Event customization private void OnMouseClick(object sender, MouseEventArgs e) { Debug.WriteLine("MouseClick event triggered"); }
//Event customization private void OnMouseDoubleClick(object sender, MouseEventArgs e) { Debug.WriteLine("MouseDoubleClick event triggered"); } |
Note: Have to trigger the control events from
SfDataGrid.TableControl instead of SfDataGrid
SfDataGrid contains the CellClick and CellDoubleClick events
support. These events raise when the mouse clicks, and the mouse double click in
SfDataGrid. Please refer to the below code snippet,
|
//Event subscription sfDataGrid1.CellClick += OnCellClick; sfDataGrid1.CellDoubleClick += OnCellDoubleClick; //Event customization private void OnCellDoubleClick(object sender, CellClickEventArgs e) { Debug.WriteLine("CellDoubleClick event triggered"); }
//Event customization private void OnCellClick(object sender, CellClickEventArgs e) { Debug.WriteLine("CellClick event triggered"); } |
For more information related to cell click, please refer to the below user guide
documentation link,
Please
find the sample in the attachment and let us know if you have any concerns
about this.
Regards,
Vijayarasan S
If this post is helpful, please consider Accepting it as the solution so that
other members can locate it more quickly.
Thanku you BIG :)
Hi Murad Jafarov,
If you are satisfied with our response, please mark it as an answer. Otherwise,
please let us know if you have any further queries on this. We are happy to
help you😊.
Regards,
Vijayarasan S