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

Retrieve Bound Object from GridGroupingControl in PrepareViewStyleInfo

Thread ID:





32477 Aug 2,2005 02:18 AM UTC Aug 2,2005 08:43 AM UTC WinForms 1
Tags: GridControl
Damien Sawyer
Asked On August 2, 2005 02:18 AM UTC

Hi, I have a gridgroupingcontrol bound to an arraylist of my custom objects (say clsItem). in the PrepareViewStyleInfo event, how can I return the object bound to the row that raised the event? I need to color the cell/row based on the value of one of the object''s properties. I have some code from the non-grouped bound grid, but can''t seem to get it to work. Thanks very much in advance, Damien Sawyer

Administrator [Syncfusion]
Replied On August 2, 2005 08:43 AM UTC

Try code like this. GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;; GridRecordRow rr = style.TableCellIdentity.DisplayElement as GridRecordRow; if((style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell) && rr != null && rr.ParentRecord != null) { object o = rr.ParentRecord.GetData(); Console.WriteLine(o); }


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