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

Accessing ComboBox inside Filter Template

1 Answer 167 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris Griffin
Top achievements
Rank 1
Chris Griffin asked on 20 May 2010, 04:27 PM
Based upon other conditions I need to change the value of a combobox inside a filter template on a grid.  Since the combobox is treated as a on runtime control, I have no access to it on the code behind.  How can I find the control and set the DataSourceID on the code behind?  Below is the combobox definition. 

 <telerik:GridBoundColumn DataField="Name" HeaderText="Applicant Name"
                        <FilterTemplate> 
                            <telerik:RadComboBox ID="ddlApplicantName" AppendDataBoundItems="true" Width='190px' 
                                Skin='Office2007' MarkFirstMatch="true" AllowCustomText="true" runat="server" 
                                DataSourceID="CurrentPostingOtherName" DataTextField="Name" DataValueField="Name" 
                                OnClientSelectedIndexChanged="NameChange" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Name").CurrentFilterValue %>'
                                <Items> 
                                    <telerik:RadComboBoxItem Text="All" /> 
                                </Items> 
                            </telerik:RadComboBox> 
                            <telerik:RadScriptBlock ID="RadScriptBlock4" runat="server"
                                <script type="text/javascript"
                                    function NameChange(sender, args) { 
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); 
                                        tableView.filter("Name", args.get_item().get_value(), "EqualTo"); 
 
                                    } 
                                </script> 
                            </telerik:RadScriptBlock> 
                        </FilterTemplate> 
                    </telerik:GridBoundColumn> 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 20 May 2010, 05:08 PM
Hello Chris,

Examine this forum thread which elaborates on this subject and see if it works for you:
http://www.telerik.com/community/forums/aspnet-ajax/grid/get-reference-to-control-embedded-in-filter-template-code-behind.aspx

Best wishes,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Chris Griffin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or