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

RadComboBox Get Filter Text on Server Side

1 Answer 203 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 26 Apr 2013, 05:56 PM
It took me a bit to figure this one out so I'd figured I'd post my solution. If anybody knows of an easier way please update.

I basically just wanted to get the filter text typed into a RadComboBox if the form was posted without a selection being made with the filter text still in the box.

If you grab the client state of the posted RadComboBox, then deserialize the JSON into an object you can grab the text:

  public class comboBoxClientSate {
    public string[] logEntries { get; set; }
    public string value { get; set; }
    public string text { get; set; }
    public bool enabled { get; set; }
    public string[] checkedIndices { get; set; }
    public bool checkedItemsTextOverflows { get; set; }
  }
 
String clientState = Request.Form[(ComboBoxID.ClientID + "_ClientState"];
comboBoxClientSate ComboBoxIDClientState = new JavaScriptSerializer().Deserialize<comboBoxClientSate>(clientState);
 
 //this should be the entered filter text
ComboBoxIDClientState .text


James

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 30 Apr 2013, 07:13 AM
Hi James,

You could use the server TextChanged event of the RadComboBox to retrieve the text entered in the input.

Regards,
Dimitar Terziev
the Telerik team
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
ComboBox
Asked by
James
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or