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
close icon

How to get value of particular column when entire row is selected

The Gridgroupingcontrol is bound to a dataset from a table "Books" that had three columns Title , Author,  Genre.

Entire row gets selected when clicked ( ListBoxSelectionMode = SelectionMode.One; )

How do I get the Title value of a selected row 

6 Replies

SR Sérgio Rodrigues Costa March 6, 2015 12:41 PM UTC

I'm going through the same experience. I would like to loop through the whole Gridgroupingcontrol obtaining certain fields . The Gridgroupingcontrol is connected to a list. I am using Entity Framework to return the data list. Can anyone help?


SR Sérgio Rodrigues Costa March 6, 2015 06:30 PM UTC

Well, I´m sorry.
I mean on GridGroupingControl.


SA Solai A L Syncfusion Team March 6, 2015 09:28 PM UTC

Hi Rem/Sergio,

Thank you for your interest in Syncfusion Products.

In order to get the particular value of a record in column wise, you can use GetValue() of record class(by passing the column name) in TableModel_SelectedRecordsChanged event. Please refer the below code snippet for further clarification.

 

Code Snippet[C#]:

foreach (GridRangeInfo range in gridGroupingControl1.TableModel.SelectedRanges)

            {

                if (range.IsRows)

                {

                    for (int i = range.Top; i <= range.Bottom; i++)

                    {

                        Record rec = gridGroupingControl1.Table.DisplayElements[i].GetRecord();

                        string colvalue = rec.GetValue("column name").ToString();

                    }

                }

            }

Please let us know if you have any other concerns.

Thanks & Regards,

AL.Solai.



SR Sérgio Rodrigues Costa March 8, 2015 12:19 PM UTC

Thank you. Works great.
Best regards.




RA Rem Aza March 9, 2015 03:45 AM UTC

Thank you . 


NK Neelakandan Kannan Syncfusion Team March 9, 2015 07:07 PM UTC

Hi Rem/Sergio,

Thank you for your update.

We are glad to hear from you that your scenario is resolved.

Please let us know if you need further assistance on this. We will assist you as early as possible.

Regards,

Neelakandan



Loader.
Live Chat Icon For mobile
Up arrow icon