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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

c# winforms sfDataGrid multiple selected cells

Thread ID:





143887 Apr 9,2019 11:13 AM UTC Apr 12,2019 04:31 AM UTC WinForms 3
Tags: SfDataGrid
Asked On April 9, 2019 11:13 AM UTC


i have the following code which gives me the value in cell 0 of the selected row.

            string idtoapp;
            var selectedItem = sfDataGrid3.SelectedItems[0];
            var dataRow = (selectedItem as DataRowView).Row;
            idtoapp = dataRow["id"].ToString();

i wish to use multiple selection and return all values of cell 0 from the rows that are selected.

your help would be mostly appreciated.

Many Thanks


Jagadeesan Pichaimuthu [Syncfusion]
Replied On April 10, 2019 06:37 AM UTC

Hi Matt, 

Thanks for using Syncfusion product. 

You can able to get the all 0th column value of the selected rows by using the below code snippet, 

List<string> items = new List<string>(); 
if (sfDataGrid1.SelectedItems.Count > 0) 
    foreach (var item in sfDataGrid1.SelectedItems) 
        var dataRow = (item as DataRowView).Row; 
        string selectedItem = dataRow[0].ToString(); 

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


Replied On April 11, 2019 02:57 PM UTC


This was perfect 

Thank you so much. 

Jagadeesan Pichaimuthu [Syncfusion]
Replied On April 12, 2019 04:31 AM UTC

Hi Matt, 
Thanks for your update. 
We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you. 


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

Live Chat Icon For mobile
Live Chat Icon