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

Filter Grid Inside ComboBox

0 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Duncan
Top achievements
Rank 1
Duncan asked on 29 Mar 2017, 01:30 AM

I currently have a RadGrid in the drop down of a RadComboBox. 

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/load-on-demand-radgrid-in-radcombobox

I turned on the filtering of the columns and hid the button because I need the grid to filter on keyress so using java to assist with this.

function Filter(colName, filtertxt) {
                        var filterTxt = document.getElementById(filtertxt);
                        var MasterTable = $find("<%= ddlProductClass.Items[0].FindControl("grdProductClass").ClientID %>").get_masterTableView();
    
                        var hidden = document.getElementById('<%= Hidden1.ClientID %>');
                        hidden.value = colName;
                        if (filterTxt.value.length > 0) {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.StartsWith);
                        }
                        else
                        {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.NoFilter);
                        }
                    }
                    function FocusFilter(filter) {
                        var input = document.getElementById(filter);
                        if (input.createTextRange) {
                            var FieldRange = input.createTextRange();
                            FieldRange.moveStart('character', input.value.length);
                            FieldRange.select();
                        }
                    } 

 

code found from another sample.  My issue is when I start typing in the filter box I get 1 or 2 characters in and the page acts like it does a post back (flickers) and combobox drop down closes.  If I open the drop down my records are filtered based on what I typed in. 

 

Any suggestions?

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Duncan
Top achievements
Rank 1
Share this question
or