I have created a simple test to check to see if the date is properly filtering and it seems to be failing every time when I have two dates with different years ... Please look at this code and test it and let me know what I am doing wrong if anything.
The first bit is my code behind for the datasource of the grid and the second is the asp code. Try and filter something like "1/1/2010" without the quotes and place the filter on less then and the results come back empty. The inverse being greater then where the no filtering occurs.
Please help asap,
Thanks!
Trevor
<
telerik:RadGrid
ID
=
"gridUsers"
AllowAutomaticDeletes
=
"true"
runat
=
"server"
AllowPaging
=
"true"
AllowSorting
=
"true"
AllowFilteringByColumn
=
"true"
PageSize
=
"10"
AutoGenerateColumns
=
"false"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
HeaderStyle
Font-Bold
=
"true"
/>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"true"
Visible
=
"true"
EnableSEOPaging
=
"true"
/>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"False"
/>
</
ClientSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
AllowNaturalSort
=
"false"
DataKeyNames
=
"Created"
>
<
Columns
>
<
telerik:GridDateTimeColumn
HeaderText
=
"Created"
ItemStyle-Wrap
=
"false"
UniqueName
=
"Created"
DataField
=
"Created"
FilterListOptions
=
"VaryByDataType"
FilterImageUrl
=
"~/images/filter_icon.gif"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected Sub gridUsers_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridUsers.NeedDataSource
Dim myDT As New DataTable
myDT.Columns.Add("Created")
Dim row1 As DataRow = myDT.NewRow
row1("Created") = Date.Now
Dim row2 As DataRow = myDT.NewRow
row2("Created") = Date.Now.AddDays(12)
Dim row3 As DataRow = myDT.NewRow
row3("Created") = Date.Now.AddYears(-2)
Dim row4 As DataRow = myDT.NewRow
row4("Created") = Date.Now.AddYears(-3)
myDT.Rows.Add(row1)
myDT.Rows.Add(row2)
myDT.Rows.Add(row3)
myDT.Rows.Add(row4)
gridUsers.DataSource = myDT
End Sub
The first bit is my code behind for the datasource of the grid and the second is the asp code. Try and filter something like "1/1/2010" without the quotes and place the filter on less then and the results come back empty. The inverse being greater then where the no filtering occurs.
Please help asap,
Thanks!
Trevor