ComboBox scrolling issue

3 posts, 0 answers
  1. kiran
    kiran avatar
    12 posts
    Member since:
    Feb 2011

    Posted 13 Oct 2011 Link to this post

     

    Hi
    I have used ComboBox control called stocksCombo in Radgrid
    In stocks ComboBox i have used another two ComboBoxes called ProductsCombo and ItemsCombo in Header Templete
    When i clicked the ProductsCombo or ItemsCombo these dropdown lists are opening but when i clicked any of the right scroll (ProductsCombo or ItemsCombo ) the stocksCombo was closing and clicked combo was still opened.How to keep open the StocksCombo even any scrolls clicked in ProductsCombo or ItemsCombo.

    Regards
    Kiran

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Oct 2011 Link to this post

    Hello Kiran,

    One suggestion is to hook OnDropDownClosing event to the child comboboxes and call the showDropDown method of the parent combobox. Since your combobox is inside RadGrid you can try the following approaches to access the ParentCombobox.

    1.Hook OnClientLoad and save the ID in a global variable and access the control with that ID. (This approach is suitable if the combobox is in EditItem Template)
    2.You can try the following code library approach .
    Accessing server controls in a grid template on the client

    Here is the sample code for the first approach.
    javascript:
    <script type="text/javascript">
    var parentCombo;
    function OnClientLoad(Sender)
      {
          parentCombo = Sender;
      }
    function ClientDropDownClosing(sender, args)
      {
         var radcombo1 =parentCombo
         radcombo1.showDropDown()
      }
    </script>

    Thanks,
    Shinu.
  3. kiran
    kiran avatar
    12 posts
    Member since:
    Feb 2011

    Posted 14 Oct 2011 Link to this post

    Hi Shinu

    Many thanks for your reply

    Its now sorted to out now , i used some flag variable on child combobox opening and also force to  canel on parent combobox closing like the below javascript

    <script language="javascript" type="text/javascript">

            var innerClosed = true;

            function OnClientChildDropDownOpening(sender, eventArgs)

             {

                innerClosed = false;

             }

           

            function OnClientParentDropDownClosing(sender, eventArgs)

             {

                 if (innerClosed == false)

                 {

                     eventArgs.set_cancel(true);

                 }

                 else

                 {

                     eventArgs.set_cancel(false);

                 }

            }

    </script>


    Regards
    Kiran


Back to Top