We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid get row from MouseDoubleClick

Hi,

i want to be able to get a underlying row / record from a MouseDoubleClick on  a SfDataGrid row.

How to achieve the desired behaivor ??

SfDataGrid is quite different from GridDataControl.

By the way, in which scenario should i take SfDataGrid and when GridDataControl.

I am little bit confused that there different DataGrids and the documentation doesn't clarify my

questions.

I hope that someone can guide me in the right direction.


Best Regards

Kim




3 Replies

JG Jai Ganesh S Syncfusion Team December 5, 2013 01:43 PM UTC

 

 

Hi Kim,

Thanks for using Syncfusion products.

We have analyzed your queries and please find the responses for your queries below,

Query 1:

You can get the row from MouseDoubleClick event in SfDataGrid  by using the “SelectedItem” property. Please find the following code snippet to illustrate this,

Code Snippet: [C#]

 

private void sfDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)

        {

            var row = sfDataGrid.SelectedItem;

        }

 

 

Query 2:

SfDataGrid is different from GridDataControl. The main difference as follows,

GridDataControl :

GridDataControl has been designed based on the Cell oriented architecture of our Winform Grid which enables the more control over cells and also provides support for Excel like features.

SfDataGrid :

SfDataGrid has been designed based on WPF template based architecture which enables the style, template the Grid very easily. The SfDataGrid performance will be better when compared to the GridDataControl.

Features

GridDataControl

SfDataGrid

Binding - for List, DataTable, ObservableCollection

Yes

Yes

Sorting – Multi column sorting, Sort numbers and Custom sorting

Yes

Yes

Grouping

Yes

Yes

Summaries – Table, Group and Caption summaries

Yes

Yes

Filtering – Provide support Excel like filtering and Custom code behind filtering

Yes

Yes

Exporting – support to export to excel

Yes

Yes

Unbound columns

Yes

Yes

Editing and Data validation

Yes

Yes

Stacked Headers

Yes

Yes

Paging and On-demand Paging

Yes

Yes

Serialization and deserialization support

Yes

Yes

Extensive support for Style customization

Yes

Yes

Nested grid

Yes

Yes

Frozen group header

No

Yes

Incremental loading - enables users to load data on demand while scrolling

No

Yes

Data virtualization - enables user to load large amount data to Grid very quickly

No

Yes

 

The documentation for the SfDataGrid in WPF is available from the following location,

Link: http://help.syncfusion.com/wpf/sfdatagrid

Please let us know if you need further assistance.

Thank you,

Jai Ganesh S



MD Marek Dobrowolski June 19, 2015 08:06 PM UTC

Hello Jai,

Can you provide a different solution to the question?  When you double click the control, it can be anywhere (column header).  I only want the double click when the row itself it double clicked or to be able to get the row source out of the MouseButtonEventArgs but cannot seem to be able to achieve this.  Do you have any suggestions?


JG Jai Ganesh S Syncfusion Team June 22, 2015 05:20 PM UTC

Hi Kim,
Thank you for the update.
We have analyzed your query. You can achieve your requirement for getting the row data by find the VirtualizingCellsControl in MouseDoubleClickevent and get the record. We have prepared the sample based on this and please find the sample under the following location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/139460/ze/SfDataGridSample1994324965

In the above sample, we have shown the EmployeeArea when double click the row.
KB Link:
http://www.syncfusion.com/kb/2450/how-to-get-the-record-when-double-clicked-on-the-row
Please let us know if you need further assistance.
Thank you,
Jai Ganesh S


Loader.
Live Chat Icon For mobile
Up arrow icon