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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get the row at the specified index the selected row collection

Thread ID:

Created:

Updated:

Platform:

Replies:

121683 Jan 15,2016 07:01 PM UTC Jan 20,2016 11:29 AM UTC WinForms 5
loading
Tags: GridDataBoundGrid(Classic)
João Ricardo Viccino
Asked On January 15, 2016 07:01 PM UTC

Hi, 
I need something like this which you can do with  DataGridView:
object objectGrid = dataGridView1.SelectedRows[0].DataBoundItem;


I can get whole databound object from selected row. 
How I can do that with GridDataBoundGrid and GridGroupingControl?

Thank You, 

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 18, 2016 11:02 AM UTC

Hi João,

Thanks for using Syncfusion products.

GridGroupingControl:

In GridGroupingControl a particular record can be retrieved by using the Record property of the SelectedRecords.

Please refer to the following KB Link:
https://www.syncfusion.com/kb/5278/how-to-retrieve-and-modify-the-selected-record-in-the-grid

GridDataBoundGrid:

You can retrieve each record in the GridDataBoundGrid by using the GetRecordStateAtRowIndex.

Please refer the following KB Link:
https://www.syncfusion.com/kb/5953/how-to-get-the-row-data-from-griddataboundgrid

Please let us know if you have any other concern.


Regards,
Jagadeesan P.

João Ricardo Viccino
Replied On January 18, 2016 04:30 PM UTC

thanks, but doesn't solve my problem

How I can do that with GridDataBoundGrid to get whole databound object from selected row and 
get the same data and put them in my class confrorme layot attached

because in datagridview (Microsoft Component C #) I can do like this

Nacionalidade nacionalidade = (gridNacionalidade.SelectedRows[0].DataBoundItem as nacionalidade);

 obs.: i´m sorry my english not very good

 thanks!


Attachment: example_99f56606.rar

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 19, 2016 12:02 PM UTC

Hi João,

Sorry for the inconvenience caused.

In order to get the row object from GridDataBoundGrid as DataGridview, use the record.Table[record.Postion] and store this to the corresponding class object. Please refer to the following code. We have also created a simple sample for your reference. In the below sample, Data is a class. By using the record.Table[record.Postion] you can get the row object and store it into Data object.

C#

GridBoundRecordState record = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(rowRangeInfo.Bottom);
Data obj2 = record.Table[record.Position] as Data;

Sample:
 http://www.syncfusion.com/downloads/support/forum/121683/ze/Sample-2134531030

Please let me know if you have any other concern.


Regards
Jagadeesan P.

João Ricardo Viccino
Replied On January 19, 2016 04:30 PM UTC

Hi Jagadeesan P.,

Problem solved!

 I'm happy!

thank you

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 20, 2016 11:29 AM UTC

Hi João,

We are glad to hear that your issue has been resolved. Please let us know if you need further assistance.

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.

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

;