Good Day Below is my RadGrid with a template column as date. The catch is that the date being bounded in the template is in long format. Therefore I convert it's value(as you can see on the DocDateLong).
The problem is how can I handle the filter value. The input in the Filter textbox should be in date format and I will just convert it in integer. After the filter/rebind executes I will convert the integer back to it's date format input in the filter textbox.
The problem is how can I handle the filter value. The input in the Filter textbox should be in date format and I will just convert it in integer. After the filter/rebind executes I will convert the integer back to it's date format input in the filter textbox.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="true" AllowRowResize="False" AllowSorting="True" BorderStyle="None" GridLines="None" PageSize="10" ShowFooter="False" ShowGroupPanel="false" Skin="WebBlue" Visible="False" Width="100%"> <ClientSettings AllowDragToGroup="true" EnablePostBackOnRowClick="true" EnableRowHoverStyle="true"> <Selecting AllowRowSelect="True" /> <ClientEvents OnRowSelected="RowSelected2" /> </ClientSettings> <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="Code" CommandItemDisplay="Top" EnableHeaderContextMenu="True" Width="100%"> <%-- <CommandItemSettings ExportToPdfText="Export to PDF" />--%><CommandItemTemplate> <div align="left"> <asp:Button ID="Button1" runat="server" CommandName="SaveSettings" Text="Save GridView Settings" /><asp:Button ID="Button2" runat="server" CommandName="DefaultSettings" Text="Restore Default Settings" /></div> </CommandItemTemplate> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn AllowFiltering="False" CurrentFilterFunction="Custom" DataField="" DefaultInsertValue="" Groupable="true" HeaderText="" ReadOnly="True" SortExpression="" UniqueName=""> <ItemTemplate> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="DecisionNo" DefaultInsertValue="" HeaderText="Decision No" SortExpression="DecisionNo" UniqueName="DecisionNo"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Subject" DefaultInsertValue="" HeaderText="Subject" SortExpression="Subject" UniqueName="Subject"> <%-- <HeaderStyle Width="600" />--%></telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="DocDateLong" DefaultInsertValue="" FilterControlAltText="Filter date column" Groupable="false" HeaderText="Document Date" ReadOnly="True" SortExpression="" UniqueName="DocDateLong"> <ItemTemplate> <asp:Label ID="lblDate" runat="server" Text='<%#Convert.ToDateTime("1900-01-01").AddDays(Convert.ToInt32(Eval("DocDateLong"))).ToString("MMMM dd, yyyy")%>'></asp:Label><%-- <asp:Label ID="lblBday" runat="server" Text='<%# Eval("Birthdate","{0:MM/dd/yyyy}")%>'></asp:Label>--%></ItemTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView><ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"> <Resizing AllowColumnResize="true" /> </ClientSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" /> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid>