Hi,
Hopefully a quick, simple problem.
I've got a RadGrid which uses the NeedDataSource event to poplute with data which works perfectly. I want to filter a column using a RadComboBox. I've followed various examples which show it working if you databind to the grid declaratively, but work out how to convert the example if I'm using the NeedDataSource method.
Thanks in advance for any help!
Johnnie
P.S. Here is my code for the filter so far:
<telerik:GridBoundColumn DataField="ArticleLength" HeaderText="S/M/L"
SortExpression="ArticleLength" UniqueName="ArticleLength" ItemStyle-HorizontalAlign="Center">
<FilterTemplate>
<telerik:RadComboBox ID="RC_FilterArticleLength" DataTextField="ArticleLength"
DataValueField="ArticleLength" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ArticleLength").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="RC_FilterArticleLengthChanged">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function RC_FilterArticleLengthChanged(sender,args) {
var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("ArticleLength",args.get_item().get_value(),"EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>