This is a migrated thread and some comments may be shown as answers.

Filtering on gridboundcolumn with dataformatstring

1 Answer 230 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vvvv
Top achievements
Rank 1
vvvv asked on 25 Feb 2014, 12:13 AM
Hi,
I am trying to set filter true on two gridbound columns of the radgrid which has dataformatstring to it. But the filtering doesnt seem to work. Here is the code for the columns. This should be something simple but still couldn't find out. Really appreciate some help. Thanks.

Filter works fine in the first one.
=======================
<telerik:GridBoundColumn DataField="divName" DataType="System.String" HeaderText="Division Of Admin"
                        Visible="true" HeaderStyle-Width="13%" FilterControlWidth="65%" SortExpression="divName"
                        UniqueName="divName" AllowFiltering="true" AutoPostBackOnFilter="true" ShowFilterIcon="false">
                    </telerik:GridBoundColumn>

Filter doesnt work
==============
 <telerik:GridBoundColumn DataField="eventDt" DataFormatString="{0:MM-dd-yyyy}" HeaderText="Event Date" Visible="true" HeaderStyle-Width="15%"
                    FilterControlWidth="65%" SortExpression="eventDt" UniqueName="eventDt" AllowFiltering="true" AutoPostBackOnFilter="true" ShowFilterIcon="false">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="startTime" DataFormatString="{0:t}" HeaderText="Event Time" Visible="true" HeaderStyle-Width="15%"
                        FilterControlWidth="65%" SortExpression="startTime" UniqueName="startTime" AllowFiltering="true" AutoPostBackOnFilter="true" ShowFilterIcon="false">
                    </telerik:GridBoundColumn>

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 25 Feb 2014, 04:28 AM
Hi,

When you choose to apply filtering for bound grid column of type DateTime, Telerik RadGrid will filter the records in the corresponding column by fetching the user entry from the filter box in the following format - mm/dd/yyyy. Please take a look at this article on Filtering for DateTime Bound Column with DataFormatString Different from mm/dd/yyyy for more information on how to achieve your requirement.

Thanks,
Princy
Tags
General Discussions
Asked by
vvvv
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or