Hi all,
Right now, I am facing a problem with my Filter Template.
I have studied this link http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx .
It is good example.
But my problem is that one of my column has some different condition.
The combo box has 4 value (i.e. New, In Progress, Near completion, Closed). it is filled by data source SDSStatus & two more items are added i.e. "All" & "Open Only".
Now, Suppose If I am select Open Only from combo,except "Closed" records all other records should be displayed in grid.
Actually, I want to know that, Is it possible to filter like this way?
Please help me its urgent.
see below code. ( That is what I am thinking ).
Right now, I am facing a problem with my Filter Template.
I have studied this link http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx .
It is good example.
But my problem is that one of my column has some different condition.
The combo box has 4 value (i.e. New, In Progress, Near completion, Closed). it is filled by data source SDSStatus & two more items are added i.e. "All" & "Open Only".
Now, Suppose If I am select Open Only from combo,except "Closed" records all other records should be displayed in grid.
Actually, I want to know that, Is it possible to filter like this way?
Please help me its urgent.
see below code. ( That is what I am thinking ).
<telerik:GridBoundColumn DataField="StatusName" HeaderText="Status Name" SortExpression="StatusName" UniqueName="StatusName" > <FilterTemplate> <telerik:RadComboBox ID="RadComboBoxSts" DataSourceID="SDSStatus" DataTextField="StsName" DataValueField="StsName" Skin="Office2007" Width = "100%" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("StatusName").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="StsIndexChanged"> <Items> <telerik:RadComboBoxItem Text="All"/>
<telerik:RadComboBoxItem Text="Open Only"/>
</Items> </telerik:RadComboBox> <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server"> <script type="text/javascript"> function StsIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
If(args.get_item().get_text() == "Open Only")
{
tableView.filter("TaskTypeName", "Closed", "NotEqualTo");
// Combo selected text must be Open Only after filtering.
}
Else
{
tableView.filter("TaskTypeName", args.get_item().get_value(), "EqualTo");
}
}
</script> </telerik:RadScriptBlock> </FilterTemplate> <HeaderStyle Width = "6%" VerticalAlign ="Top"/> <ItemStyle Width = "6%" VerticalAlign ="Top"/> </telerik:GridBoundColumn>