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

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

Article ID: Published Date: Last Revised Date: Platform: Control:
3539 01/28/2015 08/03/2015 ASP.NET MVC Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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