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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Nested properties, column binding

Thread ID:





22283 Dec 8,2004 06:00 PM UTC Dec 9,2004 11:53 PM UTC WinForms 3
Tags: GridControl
Dave Erwin
Asked On December 8, 2004 06:00 PM UTC

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 06:19 PM UTC

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 10:58 AM UTC

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 11:53 PM UTC

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.


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon