Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Drop down list from closing

Tags:

asp.net

I am using ajax toolkit -> Dropdown extender and have a gridview inside a dropdown list..

it is working quite well except for one massive problem.

Each time i do something(click on a control inside the gridview the dropdown closes) i have to open it again to do the next thing.

For example:

  1. open Dropdown
  2. Click on textbox inside gridview
  3. Dropdown closes
  4. go to 1
like image 668
AngelicCore Avatar asked Nov 27 '25 16:11

AngelicCore


1 Answers

Found here: http://www.dotnetcurry.com/ShowArticle.aspx?ID=167

You can open the drop down through javascript. Presumably when the user interacts with your control, as partial post back occurs through the update panel? If so, you might use this code in the PageLoad javascript event.

<body>
    <form id="form1" runat="server">
     <script type="text/javascript">  
    function pageLoad()
    {
          var d = $get('TextBox1');
          d.click();
    }
   </script>
... ScriptManager and other Controls come here
</body>
</html>
like image 81
jason Avatar answered Nov 30 '25 15:11

jason