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.

Retrieve Bound Object from GridGroupingControl in PrepareViewStyleInfo

Thread ID:

Created:

Updated:

Platform:

Replies:

32477 Aug 1,2005 10:18 PM Aug 2,2005 04:43 AM Windows Forms 1
loading
Tags: GridControl
Damien Sawyer
Asked On August 1, 2005 10:18 PM

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 04:43 AM

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

CONFIRMATION

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.

;