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

GridDataboundGrid Selected Rows

Thread ID:

Created:

Updated:

Platform:

Replies:

94106 Apr 21,2010 12:30 PM Apr 28,2010 04:34 AM Windows Forms 1
loading
Tags: GridControl
SantoshKumar
Asked On April 21, 2010 12:30 PM

How can i get selected row in a griddataboundgrid.

Christopher Issac Sunder K [Syncfusion]
Replied On April 28, 2010 04:34 AM

Hi Santhosh,

Thank you for your interest in Syncfusion products.

To get the selected rows, you can make use of this.gridDataBoundGrid1.Model.Selections.GetSelectedRows(false, true) to achieve it. The code is as follows,


GridRangeInfoList list = this.gridDataBoundGrid1.Model.Selections.GetSelectedRows(false, true);
foreach (GridRangeInfo range in list)
for (int i = range.Top; i <= range.Bottom; i++)
{
GridBoundRecordState rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(i);
DataRowView drv = (DataRowView)(rs.Table[rs.Position]);
DataRow dr = drv.Row;
string row = "";
object[] SelectedRow = dr.ItemArray;
for (int j = 0; j < SelectedRow.Length; j++)
row +=(string) SelectedRow[j] + " ";
richTextBox1.Text = row;
}


Please refer the sample link which gives you the solution to get the selected row.

http://help.syncfusion.com/support/samples/Grid.Windows/8.2.0.18/F94106.zip

Please let me know if you have any further concerns.

Regards,
Christopher K.

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.

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.

;