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

Finding underlying data object in GridGroupingControl from current row

I have a GridGroupingControl that is bound to an ArrayList. The records are formatted into two rows ie: gridColumnSetDescriptor1.ColumnSpans.AddRange(new GridColumnSpanDescriptor[] {..."R0C0:R1C0"...etc) I then attached to: this.previewGrid.TableControlCurrentCellActivated += new GridTableControlEventHandler(preview_TCCCA); t Inside the event handler I munge the RowIndex for the current cell to figure out the index into the arraylist, ie the ceiling of (RowIndex-2)/2. My question is: Is there a better way to do this? it seems like a rather convoluted and obtuse way to determine the underlying object for the currently selected record. The documentation is rather sparse in this area, I''m using 3.2.1.0

3 Replies

AD Administrator Syncfusion Team April 20, 2006 09:57 AM UTC

I forgot to mention, the second the grid gets sorted this doesn''t work anymore since the row index no longer has any correlation to the position in the underlying ArrayList Also my equation was a little off, its: int index = (int)Math.Floor((previewGrid.TableControl.CurrentCell.RowIndex-3)/2);


AD Administrator Syncfusion Team April 21, 2006 10:33 AM UTC

Hi Mathew, The underlying data object from current record can be retrieved with the help of record.GetData() method. Please refer to the attached sample for more details. Regards, Calvin.

SpanCol.zip


AD Administrator Syncfusion Team April 21, 2006 01:42 PM UTC

That works a lot better! Thanks

Loader.
Live Chat Icon For mobile
Up arrow icon