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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Howto Get Selected row(s) when using SelectionMode Any

Thread ID:





124314 May 31,2016 01:58 PM UTC Jun 1,2016 09:40 AM UTC WPF 1
Tags: SfDataGrid
sabrina c.
Asked On May 31, 2016 01:58 PM UTC

Just an Howto Question,

I Have a SfDataGrid in an application that contains financial data. The users would like to be able to copy the contents of the fields by Cell not by row.
Unfortunately I'm not able to set this type of selection mode because if I set the SelectionMode = Any, I am not able to get the data from the selected row(s)

This is because the SelectedItems of the datagrid are not set when the mode is Any and from the AddedItems in the event handler I'm not able to find the rows selected.

Is There a Way to get a list of the data underneath the selected objects/cells/rows when the selection is set in Any or Cell mode?

The ItemsSource is a DataTable so the SelectedItems are a collection of DataRowView when in Row Mode.

If it would be possible to get the Underneath record from the selected cells it would be easy to get just the distinct objects and build a collection of the selected rows.
But I have no Idea about how to do this.

If you have any clue it would be appreciated.

Srinivasan Vasu [Syncfusion]
Replied On June 1, 2016 09:40 AM UTC

Hi Sabrina, 
Thanks for contacting Syncfusion support. 
Query 1[Get Selected CellValue ]: 
We have analyzed your query and you have to use SelectionController.SelectedCells property or SfDataGrid.GetSelectedCells method to get the selected cells value.  
Please refer the below UG link: 
Please refer the below Kb Link: 
Query 2[ Using EventHandler]: 
When SelectionUnit is Any, you can also get the selected records from SelectionChanged event from AddedItems, which contains the collection of GridCellInfo.  
Please refer the below UG link: 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon