RadComboBox Get Filter Text on Server Side

2 posts, 0 answers
  1. James
    James avatar
    11 posts
    Member since:
    Jan 2013

    Posted 26 Apr 2013 Link to this post

    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
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 30 Apr 2013 Link to this post

    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.
Back to Top