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

Get Selected Rows

Thread ID:

Created:

Updated:

Platform:

Replies:

143314 Mar 13,2019 06:13 PM UTC Mar 15,2019 05:01 AM UTC WinForms 3
loading
Tags: SfDataGrid
Derek Geldart
Asked On March 13, 2019 06:13 PM UTC

How can I get column information for each row the user selects?  For example, if one of my columns is RecordID, how can I get a list of all the RecordIDs of the rows the user has selected?

Jagadeesan Pichaimuthu [Syncfusion]
Replied On March 14, 2019 10:31 AM UTC

Hi Derek, 

Thanks for using Syncfusion product. 

You can able to get the selected records from the SfDataGrid.SelectedItems property. Please refer the below code snippet to achieve your requirement, 

List<object> items = new List<object>();            

foreach (object item in this.sfDataGrid1.SelectedItems
    var value = this.sfDataGrid1.View.GetPropertyAccessProvider().GetValue(item, "OrderID"); 
    items.Add(value); 




 

If we misunderstood your requirement, please provide more information regarding the requirement. This would help us to proceed further. 

Regards, 
Jagadeesan 


Derek Geldart
Replied On March 14, 2019 07:42 PM UTC

This works perfect!

Jagadeesan Pichaimuthu [Syncfusion]
Replied On March 15, 2019 05:01 AM UTC

Hi Derek, 

Thanks for the update. 

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 

Regards, 
Jagadeesan 


CONFIRMATION

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

This page will automatically be redirected to the 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

;