filtering using combobox inside radgrid

5 posts, 0 answers
  1. Coolbudy
    Coolbudy avatar
    24 posts
    Member since:
    Nov 2012

    Posted 23 Nov 2012 Link to this post

    hey guys,

        i want to filtering using combobox inside my radgrid without using sqldatasource
    how can i do this?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Nov 2012 Link to this post

    Hi,

    You can use RadComboBox in FilterTemplate of the boundcolumn as shown in the following demo.
    Grid / Filter Templates

    Thanks,
    Shinu.
  3. Coolbudy
    Coolbudy avatar
    24 posts
    Member since:
    Nov 2012

    Posted 23 Nov 2012 Link to this post

    hey shinu u send me the link in this link they using sqldatasource
     <FilterTemplate>
                            <telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="SqlDataSource2" DataTextField="ContactTitle"
                                DataValueField="ContactTitle" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ContactTitle").CurrentFilterValue %>'
                                runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                <script type="text/javascript">
                                    function TitleIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("ContactTitle", args.get_item().get_value(), "EqualTo");

                                    }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>

    but i don't want to use sqldatasource is there any other method?
  4. Spdev
    Spdev avatar
    6 posts
    Member since:
    Sep 2012

    Posted 23 May 2013 Link to this post

    I'm in the same case.
    I would like to use a RadComboBox without an SqlDataSource. I need to populate this list in the code-behind...  

    could you help me please ? 

  5. Eyup
    Admin
    Eyup avatar
    4045 posts

    Posted 27 May 2013 Link to this post

    Hello,

    You can place a RadComboBox in the FilterTemplate as demonstrated in the provided demo:
    http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

    Then, you can use the server events of the combo to add the requested items or implement LoadOnDemand:
    http://www.telerik.com/help/aspnet-ajax/combobox-load-on-demand-overview.html

    Alternatively, you can access the generated combo on ItemCreated event of the grid and add the items:
    http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

    Hope this helps.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top