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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ERROR: In filter menu, Number, Date and Boolean columns have incorrect operators

Platform: ASP.NET MVC |
Control: Grid |
Published Date: January 28, 2015 |
Last Revised Date: August 3, 2015

Problem

In filter menu, Number, Date and Boolean columns contain incorrect operators.

Solution               

The Grid can get the column’s data type from the first record of data source by default. When you bind the empty data source, Grid cannot find the actual data type of a column. In this case, you have to set the data type of the column explicitly. The available column data type is tabulated as follows.

Type

Description

string

Returns the text value in the column cells.

number

Returns the numeric value in the column cells.

date

Returns the date format of the column cells and the date picker renders automatically on edit and time without specifying the editType Property.

datetime

Returns the datetime format of the column cells and the date time picker renders automatically on edit time without specifying the editType Property.

boolean

Returns the true or false value.

Refer to the following code example to enable Type property in Grid.

columns: [

                         { field: "Number", type: "string", width: 90 }

                ]

The highlighted code in the following code example illustrates the customization of Column types. The code example explains about how to render the filter menu even when the database contain NULL values in certain records, and to render the date picker on edit mode without specifying the editType of the column.

JS

MVC

Controller

ASPX

ASPX.CS

The following screenshot illustrates the output.

Customized Grid

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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