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

GetNextCell in virtual grid

Thread ID:





7697 Oct 6,2003 09:53 PM UTC Oct 6,2003 10:08 PM UTC WinForms 1
Tags: GridControl
Sue Harris
Asked On October 6, 2003 09:53 PM UTC

I'm having trouble using the GetNextCell in a virtual grid when selecting rows. It seems, no matter how many columns I actually have, GetNextCell keeps returning columns which don't exist. Is there something wrong with the following code? ArrayList rows = new ArrayList(); GridRangeInfoList selectedRows = this.gridControl1.Selections.GetSelectedRows(false, true); foreach (GridRangeInfo info in selectedRows ) { int top; int left; if ( info.GetFirstCell(out top, out left) ) { do { if ( !rows.Contains(top) ) { rows.Add(top); } } while( info.GetNextCell( ref top, ref left )); } } Thanks, Sue

Administrator [Syncfusion]
Replied On October 6, 2003 10:08 PM UTC

The call to GetSelectedRows will return ranges of type GridRangeType.Row. The GetNextCell type works only with GridRangeType.Cell. What you should do is before the call to if ( info.GetFirstCell ... you should call info.ExpandRange(1, 1, RowCount, ColCount); This will convert the Row range into a Cell range that you can loop through. Stefan


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