William Silva wrote:
i wanna imitate the action click on DropDrownList... show the items... but i wanna make this in the event on focus
What you are trying is to expand/open the dropdownlist and show its items on focus itself instead of clicking it.
As such, this showing/expanding the list is
not a feature provided and cannot be done. Though there is a workaround to it which can be used if the result is acceptable.
Workaround:
1. Get the total number of items shown in the dropdown (lets say N).
2. Now on focus, call a JavaScript function that will change the 'size' of the dropdown from 1 to N
Something like:
<select id="mySelect" runat="server" onfocusin="Open_Dropdownlist()" onfocusout="Close_Dropdownlist()">
function Open_Dropdownlist()
{
document.getElementById("mySelect").size=N;
}
function Close_Dropdownlist()
{
document.getElementBById("mySelect").size=1;
}