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

ComboBox scrolling issue

2 Answers 117 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
kiran
Top achievements
Rank 1
kiran asked on 13 Oct 2011, 09:31 AM

 

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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Oct 2011, 09:42 AM
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.
0
kiran
Top achievements
Rank 1
answered on 14 Oct 2011, 01:08 PM
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


Tags
ComboBox
Asked by
kiran
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
kiran
Top achievements
Rank 1
Share this question
or