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

Type Conversion.

Thread ID:





14808 Jun 4,2004 05:06 PM UTC Jun 4,2004 08:08 PM UTC WinForms 1
Tags: GridControl
Asked On June 4, 2004 05:06 PM UTC

I have a GriddataboundGrid control which displays the property of some class in the read only fashion. One property in the class is of type "int" which I would like to display as a string inside the Grid ( Example: 1 - America, 2 - Europe etc. ). I try to decorate the particular property with the: [TypeConverter(typeof(MyConverterClass))] attribute to do the conversion for me. This works for the .NET native controls but in the case of the GridDataBoundGrid the conversion does NOT happend. Does the Syncfusion GridDataBoundGrid use this type of attribute for conversion? What other mechanisms can I employ to do the necessary conversion for me.

Administrator [Syncfusion]
Replied On June 4, 2004 08:08 PM UTC

I will have to check to see whether the typeconverter attribute should be picked up by our grid. One way you can do this is create a DataTable with 2 columns, DisplayMember and ValueMember (or create an arraylist of objects where the object have properties DisplaMember and ValueMember). For the displaymember, use the text you want to see. For the valuemember, set the integer value. You can then set GridStyleInfo style = this.grid.Binder.InternalColumns["Col1"].StyleInfo; style.DataSource = MyDataTable; //or arraylist style.DisplayMember = "DisplayMember"; style.ValueMember = "ValueMember"; style.ShowButtons = GridShowButtons.Hide;


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