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

Using Filter Templates When ComboBox Used with Edit Template

1 Answer 33 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Carol
Top achievements
Rank 1
Carol asked on 05 May 2017, 03:43 PM
<telerik:GridTemplateColumn HeaderText="Emp"HeaderStyle-Width="27%" UniqueName="EmpID" DataField="EmpID">                              <FilterTemplate>
    <telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBoxEmp" DataSourceID="dsEmpNameFilter" <br>                                                DataTextField="EmpName"<br>                                                DataValueField="EmpID" <br>                                                Width="100%" AppendDataBoundItems="true" <br>                                                SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("EmpID").CurrentFilterValue%>'<br>                                                runat="server" OnClientSelectedIndexChanged="EmpNameIndexChanged"><br>                                                <Items><br>                                                    <telerik:RadComboBoxItem Text="All" /><br>                                                </Items><br>                                            </telerik:RadComboBox><br>                                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server"><br>                                                <script type="text/javascript"><br>                                                    function EmpNameIndexChanged(sender, args) {<br>                                                        var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");<br>                                                        tableView.filter("EmpID", args.get_item().get_value(), "EqualTo");<br>                                                    }<br>                                                </script><br>                                            </telerik:RadScriptBlock><br>                                        </FilterTemplate><br><br>                                        <ItemTemplate><br>                                            <%# Eval("EmpName")%><br>                                        </ItemTemplate><br>                                        <EditItemTemplate><br>                                            <telerik:RadDropDownList RenderMode="Lightweight" runat="server" ID="EmpIDDropDown" DataValueField="EmpID"<br>                                                DataTextField="EmpName" DataSourceID="dsEmployees"><br>                                            </telerik:RadDropDownList><br>                                        </EditItemTemplate><br>                                    </telerik:GridTemplateColumn></p>

1 Answer, 1 is accepted

Sort by
0
Carol
Top achievements
Rank 1
answered on 05 May 2017, 03:53 PM

Don't know how to edit this post, it posted prematurely, and the code is exact, but not formatted as desired.

I double-checked my markup several times, using the demo as a model.  The edit template contains a combobox displaying Employee Name with a data value of EmpID.  The custom filter is set up to filter on EmpID, but gets hung up will selection is made from filter drop-down, except when ALL is selected.

How can I get filtering to work?

Tags
Filter
Asked by
Carol
Top achievements
Rank 1
Answers by
Carol
Top achievements
Rank 1
Share this question
or