Completed
Last Updated: 04 Jun 2024 16:13 by Wayne
Wayne
Created on: 28 May 2024 13:45
Category: UI for ASP.NET AJAX
Type: Feature Request
0
Add demo scenario when MultiColumnComboBox is used as RadGrid column filter
Please consider to add a demo scenario when MultiColumnComboBox is used as RadGrid column filter
3 comments
Wayne
Posted on: 04 Jun 2024 16:13

Thanks for sample code, Vasko!

Please ensure that filtering works when cleaning up the filter value by clicking "X".

ADMIN
Vasko
Posted on: 04 Jun 2024 08:15

Hello again Wayne,

The scenario is now implemented live in the Filter Grid columns with MultiColumnComboBox article.

Kind regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
ADMIN
Vasko
Posted on: 04 Jun 2024 06:55

Hi Wayne,

Thank you for the suggestion. Below you can find a sample implementation of the scenario: 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" Width="800px" AllowFilteringByColumn="True">
    <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="false" DataKeyNames="CustomerID">
        <Columns>
            <telerik:GridBoundColumn UniqueName="CustomerID" HeaderText="Customer ID" DataField="CustomerID" />
            <telerik:GridBoundColumn UniqueName="ContactName" HeaderText="ContactName" DataField="ContactName">
                <FilterTemplate>
                    <telerik:RadMultiColumnComboBox runat="server" ID="RadMultiColumnComboBox1" DataSourceID="SqlDataSource1"
                        Filter="contains" FilterFields="ContactName, ContactTitle, CompanyName" Width="400px" Height="300px"
                        DataTextField="ContactName" DataValueField="CustomerID"
                        Placeholder="select from the dropdown or type">
                        <ColumnsCollection>
                            <telerik:MultiColumnComboBoxColumn Field="ContactName" Title="Name" Width="200px" />
                            <telerik:MultiColumnComboBoxColumn Field="ContactTitle" Title="Title" Width="200px" />
                            <telerik:MultiColumnComboBoxColumn Field="CompanyName" Title="Company" Width="200px" />
                        </ColumnsCollection>
                        <ClientEvents OnChange="onChange" />
                    </telerik:RadMultiColumnComboBox>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ContactTitle" HeaderText="ContactTitle" DataField="ContactTitle" />
            <telerik:GridBoundColumn UniqueName="CompanyName" HeaderText="CompanyName" DataField="CompanyName" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    ProviderName="System.Data.SqlClient"
    SelectCommand="SELECT [CustomerID], [ContactName], [ContactTitle], [CompanyName] FROM [Customers]"></asp:SqlDataSource>
function onChange(sender, args) {
    var grid = $find("<%=RadGrid1.ClientID %>");
    var tableView = grid.get_masterTableView();
    var filterText = sender.get_dataItem().ContactName; // You can also specify the other fields, depending on the returned data

    tableView.filter("ContactName", filterText, "EqualTo");
}

Additionally, the above implementation will be made into a knowledge-base article. 

Kind regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources