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.

Finding underlying data object in GridGroupingControl from current row

Thread ID:





43308 Apr 20,2006 05:40 AM Apr 21,2006 09:42 AM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On April 20, 2006 05:40 AM

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

Administrator [Syncfusion]
Replied On April 20, 2006 05:57 AM

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);

Administrator [Syncfusion]
Replied On April 21, 2006 06:33 AM

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.


Administrator [Syncfusion]
Replied On April 21, 2006 09:42 AM

That works a lot better! Thanks


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.