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

filtering using combobox inside radgrid

4 Answers 666 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Coolbudy
Top achievements
Rank 1
Coolbudy asked on 23 Nov 2012, 07:26 AM
hey guys,

    i want to filtering using combobox inside my radgrid without using sqldatasource
how can i do this?

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Nov 2012, 07:54 AM
Hi,

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

Thanks,
Shinu.
0
Coolbudy
Top achievements
Rank 1
answered on 23 Nov 2012, 08:16 AM
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?
0
Spdev
Top achievements
Rank 1
answered on 23 May 2013, 10:39 AM
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 ? 

0
Eyup
Telerik team
answered on 27 May 2013, 01:14 PM
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.
Tags
General Discussions
Asked by
Coolbudy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Coolbudy
Top achievements
Rank 1
Spdev
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or