Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Sorting and Filtering DateTime field in WebDataGrid
posted

Hi,

I'm using a WebHierarchicalDataGrid which has a DateTime field to be bound. I have enabled sorting and filtering. When I execute the page I'm getting the following error message.

The filtering rule condition of type Infragistics.Web.UI.GridControls.RuleNumberNode is not an appropriate type for column <Column Name>, which is of type System.DateTime.

It's working fine if I removed the filtering at all. But I need filtering as well. I tried converting my DateTime field in the stored procedure as "CONVERT( VARCHAR(10), I.InvoiceDate, 101)". Then it's working fine, but the sorting is happening wrongly for this column.

I also tried adding ColumnFilters with the RuleDateNode for the grid as follow, but it still throws the same error.

<ig:Filtering>
    <ColumnFilters>
        <ig:ColumnFilter ColumnKey="InvoiceDate">
            <ConditionWrapper>
                <ig:RuleDateNode Rule="Equals"/>
            </ConditionWrapper>
        </ig:ColumnFilter>
    </ColumnFilters>
</ig:Filtering>

My ultimate goal is to have both Sorting and Filtering for my DateTime field and I'm wondering how Infragistics does not have this. How can I achieve this?