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

combobox filter for a hierarchy grid (and other questions)

6 Answers 120 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Cholo
Top achievements
Rank 2
Cholo asked on 07 Apr 2016, 02:36 AM

Any tips or directions on how i can make a cascading combobox filter for a nested table?

Currently i have a grid that has 2 tables (a parent and a child).

6 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 Apr 2016, 12:44 PM
Hi Cholo,

You can use FilterTemplates to achieve this requirement. Place the combos within the template and implement your custom cascading logic:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

You can also check the first web site from this post:
http://www.telerik.com/forums/how-to-persist-dropdownlist-selected-index-and-value-on-postback-from-radgrid-filtertemplate#GW3MyQLmVEmy8XzsmrHzeQ


Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Cholo
Top achievements
Rank 2
answered on 13 Apr 2016, 03:08 AM

Thank you Eyup. Figured it out!

I even managed to place the outside the grid.

Here's what it looked like

<table id="filter">
    <tr>
        <th colspan="2">Filter Data</th>
    </tr>
    <tr>
        <td>by Group Company</td>
        <td>
            <telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="Select" AutoPostBack="true" DataSourceID="ddlGroupCompany" DataTextField="GroupCompany" DataValueField="GroupCompany" Width="186px" AppendDataBoundItems ="true" >
                <Items>
                    <telerik:RadComboBoxItem Text="All" Value="0" Selected="true"></telerik:RadComboBoxItem>
                </Items>
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>by Company</td>
        <td>
            <telerik:RadComboBox ID="RadComboBox2" runat="server" EmptyMessage="Select" DataSourceID="ddlCompany" DataTextField="CompanyUserName" DataValueField="CompanyUserName" Width="186px">
            </telerik:RadComboBox>
        </td>
    </tr>
     <tr>
        <td>by Customer</td>
        <td>
            <telerik:RadComboBox ID="RadComboBox3" runat="server" EmptyMessage="Select" DataSourceID="ddlCustomer" DataTextField="UserName" DataValueField="UserName" Width="186px">
            </telerik:RadComboBox>
        </td>
    </tr>
 </table>

For the SQL tables, indicated a control, it looked like this

*SQL for the 3rd (RadComboBox3 in this example)

<asp:SqlDataSource ID="ddlCustomer" runat="server" ConnectionString='<%$ ConnectionStrings:SiteSqlServer %>' SelectCommand="SELECT * FROM [Customer] WHERE ([GroupCompany] = @GroupCompany)">
    <SelectParameters>
        <asp:ControlParameter ControlID="RadComboBox1" PropertyName="SelectedValue" Name="GroupCompany" Type="String"></asp:ControlParameter>
    </SelectParameters>
</asp:SqlDataSource>

And here's what it looks like inside the AjaxManager

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID ="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadComboBox1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadComboBox2" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                <telerik:AjaxUpdatedControl ControlID="RadComboBox3" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadComboBox1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadComboBox3"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>

I may have some redundancies here. Let me know if there's anything i can improve on or i missed out on anything. 

Thanks

 

0
Cholo
Top achievements
Rank 2
answered on 13 Apr 2016, 03:11 AM

UPDATE: may have figured out how to make the cascade itself but still having difficulties using the 2nd control the nested grid.

Also, due to changes that to be made, had to join 2 SQL tables for the nested grid (details table). Is it possible with to create a filter for that kind of grid?

 

0
Eyup
Telerik team
answered on 15 Apr 2016, 01:43 PM
Hi Cholo,

I'm afraid it is difficult to figure out your exact requirement. Could you elaborate on your scenario and send us screenshots or video demonstrating the desired behavior?

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Cholo
Top achievements
Rank 2
answered on 23 Apr 2016, 03:02 AM

Hi Eyup,

Here's what's currently working:

This shows how the  work for this module (thanks to your tip)

http://imgur.com/JKuekY0

What need is to have the 2nd  'Company' control the content of the nested table

http://imgur.com/1UWceoy

In addition, the nested table doesn't have the column 'Company' and had to join it with another table (ProductCodes). Here's what the table relationship looks like:

http://imgur.com/CWSDUHG

is this possible? 

Let me know if you need me to further elaborate on what i need. Thank you for the help.

0
Eyup
Telerik team
answered on 28 Apr 2016, 05:40 AM
Hello Cholo,

For further instructions, please open a formal support ticket and send us a very basic runnable prototype of your application so we can further investigate it.

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Cholo
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Cholo
Top achievements
Rank 2
Share this question
or