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/cells in griddataboundgrid

Thread ID:





81238 May 18,2009 12:38 PM UTC May 23,2009 06:47 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On May 18, 2009 12:38 PM UTC


I am using GridDataBoundGrid and need to get the contents of the selected rows. I am looking something like the DataGridViewSelectedRowCollection in windows forms.

I am using the MultiExtended selection mode as below:

_aggregateGrid.ListBoxSelectionMode = SelectionMode.MultiExtended; [so that whole rows are selected instead of individual cells]

If the user selects 2 rows, how do I get the contents of the selected rows(I need to get the cell values as well). Also I need to find out which cell was selected first.

I tried using :

GridRangeInfoList rangeList = new GridRangeInfoList();
_aggregateGrid.Selections.GetSelectedRanges(out rangeList, true);
if (rangeList.Count > 0)
foreach (GridRangeInfo range in rangeList)
GridStyleInfo[] info = _aggregateGrid.Model.GetCellsInfo(range);

but this returns info as null.


Lingaraj S [Syncfusion]
Replied On May 23, 2009 06:47 AM UTC

Hi Tanmay,

Thank you for your interest in Syncfusion product.

If you want to get the selected cells in GridDataBoundControl. Please try using GridRangeInfo properties to acheive this behaviour.

Please refer the code below:

GridRangeInfoList list;
if(this.gridDataBoundGrid1.Selections.GetSelectedRanges(out list, true))
foreach(GridRangeInfo range in list)
List range = new List();
for(int i = range.Top; i <= range.Bottom; i++)
for(int j= range.Left; j <= range.Right; j++)

Please let me know if it helps.

Lingaraj S.


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

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