Hi Friends,
i am using radgrid to display some records which includes date filed also.
In the grid i have provider filter option in the command item template as specified below
<telerik:GridTemplateColumn HeaderStyle-Width="75px" HeaderText="Modified" ItemStyle-Width="75px" UniqueName="Modified">
<ItemTemplate>
<asp:Label ID="lblModified" runat="server" Text='<%# iif(Eval("Modified") & "" <> "",format(Eval("Modified"),"MM/dd/yyyy"),"") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
'-------------------------------------------------------------------------------------------------------------------------
<CommandItemTemplate>
<asp:TextBox autocomplete="off" ID="txtSearch" runat="server" EnableTheming ="true"></asp:TextBox>
<telerik:RadCombobox ID="rcbFieldName" runat="server" AllowCustomText="True"
<Items>
<telerik:RadComboBoxItem Text="Name" Value="StructureName LIKE '%-VALUE-%'" />
<telerik:RadComboBoxItem Text="Description" Value="Description LIKE '%-VALUE-%'" />
<telerik:RadComboBoxItem Text="Created" Value="Created LIKE %-VALUE-%'" />
<telerik:RadComboBoxItem Text="Modified" Value="Modified LIKE '%-VALUE-%'" />
</Items>
<collapseanimation duration="200" type="OutQuint"></collapseanimation>
</telerik:RadCombobox>
</CommandItemTemplate>
'----------------------------------------------------------------------------------------------------------
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Case "FilterUsersBy"
Dim txtSearch As TextBox = CType(e.Item.FindControl("txtSearch"), TextBox)
Dim rcbFieldName As RadComboBox = CType(e.Item.FindControl("rcbFieldName"), RadComboBox)
RadGrid1.MasterTableView.FilterExpression = Replace(rcbFieldName.SelectedValue, "%-VALUE-%", txtSearch.Text)
RadAjaxManager1.Alert(RadGrid1.MasterTableView.FilterExpression.ToString)
RadAjaxManager1.Alert(RadGrid1.MasterTableView.e
RadGrid1.MasterTableView.Rebind()
End Select
end sub
my search for date is not working (but for the othere 2 fileds its working fine)
i am not sure whether the code is wrong or the input for search i am providing is wrong
wht is the format i have to search for date '02/21/2009' or '02/21/2009 00:00:00.000'
can any one plzzz help me........
Thanx in advance
K²
i am using radgrid to display some records which includes date filed also.
In the grid i have provider filter option in the command item template as specified below
<telerik:GridTemplateColumn HeaderStyle-Width="75px" HeaderText="Modified" ItemStyle-Width="75px" UniqueName="Modified">
<ItemTemplate>
<asp:Label ID="lblModified" runat="server" Text='<%# iif(Eval("Modified") & "" <> "",format(Eval("Modified"),"MM/dd/yyyy"),"") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
'-------------------------------------------------------------------------------------------------------------------------
<CommandItemTemplate>
<asp:TextBox autocomplete="off" ID="txtSearch" runat="server" EnableTheming ="true"></asp:TextBox>
<telerik:RadCombobox ID="rcbFieldName" runat="server" AllowCustomText="True"
<Items>
<telerik:RadComboBoxItem Text="Name" Value="StructureName LIKE '%-VALUE-%'" />
<telerik:RadComboBoxItem Text="Description" Value="Description LIKE '%-VALUE-%'" />
<telerik:RadComboBoxItem Text="Created" Value="Created LIKE %-VALUE-%'" />
<telerik:RadComboBoxItem Text="Modified" Value="Modified LIKE '%-VALUE-%'" />
</Items>
<collapseanimation duration="200" type="OutQuint"></collapseanimation>
</telerik:RadCombobox>
</CommandItemTemplate>
'----------------------------------------------------------------------------------------------------------
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Case "FilterUsersBy"
Dim txtSearch As TextBox = CType(e.Item.FindControl("txtSearch"), TextBox)
Dim rcbFieldName As RadComboBox = CType(e.Item.FindControl("rcbFieldName"), RadComboBox)
RadGrid1.MasterTableView.FilterExpression = Replace(rcbFieldName.SelectedValue, "%-VALUE-%", txtSearch.Text)
RadAjaxManager1.Alert(RadGrid1.MasterTableView.FilterExpression.ToString)
RadAjaxManager1.Alert(RadGrid1.MasterTableView.e
RadGrid1.MasterTableView.Rebind()
End Select
end sub
my search for date is not working (but for the othere 2 fileds its working fine)
i am not sure whether the code is wrong or the input for search i am providing is wrong
wht is the format i have to search for date '02/21/2009' or '02/21/2009 00:00:00.000'
can any one plzzz help me........
Thanx in advance
K²