This is a migrated thread and some comments may be shown as answers.

RadGrid filtering by the RadComboBox which is outside the grid

0 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Константин
Top achievements
Rank 1
Константин asked on 15 May 2018, 08:44 AM

I tried this code to filter radgrid from the external radcombox located outside the Grid. And i have a problem with it. Visual Studio debugger and SQL Profiler show that this code works and send to radgrid correct filter expression with the correct filter value. But radgrid doesn't filtrate data with this expression while rebinding. It shows all data without any filtering after rebinding. How can I solve it?
This is my code C#:

protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    radgrid.MasterTableView.FilterExpression = "[service_id] LIKE '%" + ddlService.SelectedValue + "%' ";
    GridColumn column = radgrid.MasterTableView.GetColumnSafe("serv_id");
    column.CurrentFilterFunction = GridKnownFunction.EqualTo;
    column.CurrentFilterValue = ddlService.SelectedValue;
    column.AndCurrentFilterFunction = GridKnownFunction.EqualTo;
    radgrid.MasterTableView.Rebind();
}

This is my ASPX code with combox setting:

<telerik:RadComboBox ID="ddlService" runat="server" Height="200" Width="240"
  DropDownWidth="310"  DataSourceID="dsServices"
 EmptyMessage="- Select Product -"
HighlightTemplatedItems="true" CausesValidation="false"
Filter="Contains" AppendDataBoundItems="true"
onselectedindexchanged="RadComboBox1_SelectedIndexChanged"
SelectedValue='<%# radgrid.MasterTableView.GetColumn("serv_id").CurrentFilterValue %>'
AllowCustomText="true" AutoPostBack="true" DataTextField="service_name" DataValueField="id"
>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Константин
Top achievements
Rank 1
Share this question
or