I have a GridTemplateColumn that is defined as with a DateTime", but actually contains a link button. The value in the column is a date, but since the ItemTemplate is defined as a link button the actual filter value is a string. When you search if you enter a valid date value it will filter correctly, but if you enter a 2, for example, the SQL gets an error because you obviously can't compare 2 to a date field.
What I want to do is before the filter is performed validate that it is a valid date, if not just remove the filter. Additionally, I would really like to be able to add the date selector box next to the filter field. That would help in getting the date in the correct format.
Below is the definition for the column:
<
telerik:GridTemplateColumn
UniqueName
=
"CREATEDON"
DataField
=
"CREATEDON"
SortExpression
=
"CREATEDON"
HeaderText
=
"Date Created"
DataType
=
"System.DateTime"
CurrentFilterFunction
=
"GreaterThanOrEqualTo"
AutoPostBackOnFilter
=
"true"
HeaderStyle-Width
=
"100"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkCreatedOn"
runat
=
"server"
CommandName
=
"VIEWTASK"
CommandArgument='<%# Eval("TaskId") %>' OnClick="lnkCreatedOn_Click" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Thanks in advance.
Rodney