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.
Syncfusion Feedback

Expression Field Type

Thread ID:

Created:

Updated:

Platform:

Replies:

40549 Feb 6,2006 05:38 PM UTC Feb 7,2006 07:23 PM UTC Windows Forms 3
loading
Tags: Grouping
Heath Brand
Asked On February 6, 2006 05:38 PM UTC

Hi, I''m getting an exception when the wrong type is assigned to an expression field. For example, Run the MultipleRecordSelection sample in the Grid.Grouping samples, and add an expression field using the property editor as follows: [CustomerID] like ''ALFKI'' It creates the expression field column in the grid, but when you move the mouse over the column an exception is generated. Is there any way to avoid this? In my app the user is free to select any type from the list. thanks, Heath

Administrator [Syncfusion]
Replied On February 7, 2006 05:52 AM UTC

I forgot to mention that I''m assigning the System.Boolean type to the expression field result. >Hi, > >I''m getting an exception when the wrong type is assigned to an expression field. For example, > >Run the MultipleRecordSelection sample in the Grid.Grouping samples, and add an expression field using the property editor as follows: > >[CustomerID] like ''ALFKI'' > >It creates the expression field column in the grid, but when you move the mouse over the column an exception is generated. > >Is there any way to avoid this? In my app the user is free to select any type from the list. > >thanks, >Heath >

Administrator [Syncfusion]
Replied On February 7, 2006 02:19 PM UTC

Hi Heath, right now the only option to get this working is to add a custom function with ExpressionFieldEvaluator.AddFuntion and that function returns "True" or "False". But we can also add support for automatic type conversion to boolean when "1" or "0" is returned. We already have the Syncfusion.Styles.ValueConvert.ChangeType function that takes care of sucn conversions but we did not use it in FieldDescriptor.GetValue. We can change that for future builds. Stefan >I forgot to mention that I''m assigning the System.Boolean type to the expression field result. > > > >>Hi, >> >>I''m getting an exception when the wrong type is assigned to an expression field. For example, >> >>Run the MultipleRecordSelection sample in the Grid.Grouping samples, and add an expression field using the property editor as follows: >> >>[CustomerID] like ''ALFKI'' >> >>It creates the expression field column in the grid, but when you move the mouse over the column an exception is generated. >> >>Is there any way to avoid this? In my app the user is free to select any type from the list. >> >>thanks, >>Heath >>

Heath Brand
Replied On February 7, 2006 07:23 PM UTC

Thanks for the idea. I may have found an alternate solution that will fix my problem, which is always use System.String as the expression field result type. Then use the Cell Value Type to format the value as needed (e.g. convert to a Boolean or some other type). Using System.String as the exp. field result type seems to always work and never crashes the grid, even if the expression syntax is incorrect. If this sounds off, please let me know. thanks, Heath

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.

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

;