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.

Nested properties, column binding

Thread ID:

Created:

Updated:

Platform:

Replies:

22283 Dec 8,2004 01:00 PM Dec 9,2004 06:53 PM Windows Forms 3
loading
Tags: GridControl
Dave Erwin
Asked On December 8, 2004 01:00 PM

In http://www.syncfusion.com/support/forums/printthread.aspx?MessageID=15123 you suggested handling a nested object property by using gbc.MappingName="IncType" and then retrieving the object through e.style.cellvalue and then setting e.style.text to the nested property. The problem is that when the object is assigned to the MappingName it''s ToString gets used and the object retrieved through e.style.cellvalue is a system.string, not the object. I''ve tried both prepareviewstyleinfo and model.querycellinfo. How do you go about retrieving the actual object from e.style.cellvalue? TIA

Administrator [Syncfusion]
Replied On December 8, 2004 01:19 PM

Are you setting the CellValueType for this cell? If so, then CellValue should return the proper type if it is assigned the proper object. There is another way you can handle showing nested properties. You can add unbound columns to manage this, and have your Parent class implement ITypedList to help with providing values through QueryCellInfo and SaveCellInfo events. Here is a little sample.

Dave Erwin
Replied On December 9, 2004 05:58 AM

No, I wasn''t setting the CellValueType, but now I''m having trouble figuring out how to do that. My first thought is to set it with .styleinfo.cellvaluetype when the gbc is being setup before it is added to the grid. I''ve tried .styleinfo.cellvaluetype=gettype(IncType) but in querycellinfo the e.style.cellvalue.gettype.tostring still says that it is system.string. Is this the correct way to set the cellvaluetype? Are there any plans to make nested properties easier? Is it changed in 3.0? Thanks for the clue anyway.

Administrator [Syncfusion]
Replied On December 9, 2004 06:53 PM

That is how you woudl try to set the CellValueType, using teh GridBoundColumn.CellCalueType. In 3.0, the GridGourpingControl deos a better job of using nested properties. But the support in teh GriddataBoundGrid is the same. If you can post a sample project showingteh problem you ar ehaving (or submit a Direct Trac incident with a sample),we can try to see if we can get it working.

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.

;