ComboBox And WebService

3 posts, 0 answers
  1. Babak
    Babak avatar
    12 posts
    Member since:
    Jan 2012

    Posted 01 Jun 2014 Link to this post

    Hi . 
    I have 3 control in a form , 
    2  Radcombobox and a button . 
    the first radcombobox binded to webservice and the second bind in server side code .
    both radcomboboxes have AutoPostback="true" attribute . 
    when I choose an item from the first combo the second bind with item that selected from the first combo . 
    but I have problem when I choose an item from the second combo and do post back . after post back it seems that the first combo box dose not have any item selected. 
    I write a custome validation in clientside code that checked the value of first combo . after second combobox post back the customevalidator return null .
    function ClientValidate_<%= this.ClientID %>(source, args) {
                var combo = $find("<%= ExComboControl.ClientID %>");
                if (combo.get_enabled()) {
                    args.IsValid = false;
                    var text = combo.get_text();
                    if (text.length < 1) {
                        args.IsValid = false;
                        combo.set_emptyMessage("Please choose an Item");
                    else {
                        var node = combo.findItemByText(text);
                        var inputElement = combo.get_inputDomElement();
                        if (node) {
                            args.IsValid = true
                            args.IsValid = false;
                   = "black";
                        else {
                            args.IsValid = false;
                   = "#FF0000";
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 01 Jun 2014 in reply to Babak Link to this post

    Hi Babak
    I understand you have written the client code only to check on the Combo Box

    1. Please check if you have some thing written on the page_load event which is not with "If Not IsPostBack"
    2. Probably when you are loading the second combo you are clearing the first combo
    3, If you code is on Items_Requested event then on the AJAX call probably the first combo is clearing off
    4. If it is ok please post your code


  3. DevCraft R3 2016 release webinar banner
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jun 2014 in reply to Babak Link to this post

    Hi Babak,

    With reference to this help documentation RadComboBox items loaded on demand using the ItemsRequested event handler or WebService do not exist on the server and cannot be accessed using the server-side FindItemByText / Value methods. The properties that are accessible on the server are Text and SelectedValue.

    Let me know if you have any concern.
Back to Top