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

text not displaying

Thread ID:





1136 Sep 25,2002 05:06 PM UTC Sep 26,2002 10:12 AM UTC WinForms 2
Tags: GridControl
Andre King
Asked On September 25, 2002 05:06 PM UTC

Hi I have a databound grid that uses a datatable whose columns are of type object. In the datatable are mixed data types. The problem I am having is that string types do not display. Floats, decimal and datetime are ok. I have attached a zip that reproduces the problem. If I print out the values from the preparestyle event g[r,c].CellValue - I can see the strings are in the grid. Can you tell me what I am doing wrong? thanks p.s. if the datacolumn is type string, its fine for strings

Administrator [Syncfusion]
Replied On September 26, 2002 05:51 AM UTC

Andre, I think this is probably a bug. I will submit it so it can be addressed in a release. In the meantime, I think you can get things to behave properly for string cells that have cellvaluetype set to objects, by handling PrepareViewStyleInfo and temporarily explicitly setting the cellvaluetype at that point for this case.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
	if( e.Style.CellValueType == typeof(object) && e.Style.CellValue as string != null)
		e.Style.CellValueType = typeof(string);

Andre King
Replied On September 26, 2002 10:12 AM UTC

Thanks for the work around.


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