Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
can anyone help me?
 
i wanna a make a dropdownlist that on focus shows your listItens!Thumbs Up | :thumbsup:
easy! =)
 
improve..
 
my dropDownList already populated...
 
i wanna imitate the action click on DropDrownList... show the items... but i wanna make this in the event on focus.
 
is it clear now!? Cool | :cool:
Posted 24-Jun-10 9:15am
Edited 25-Jun-10 6:54am
v3
Comments
Sandeep Mewara at 24-Jun-10 15:43pm
   
What do you mean by dropdown showing listitems? Do you want to show listitems on selection of particular dropdown item or you are saying a focus on textbox should show a listview?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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;
}
  Permalink  
v2
Comments
William Silva at 25-Jun-10 9:15am
   
i've already made this, but this action do not imitated a click on dropdownlist that is i wanna to do.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You should look up jQuery. Loading your list items once the pages are loaded is going to require a callback of some form.
  Permalink  
Comments
Sandeep Mewara at 24-Jun-10 15:44pm
   
Are you clear with the question? Not sure if OP is really asking loading listitem after pageload.
hammerstein05 at 24-Jun-10 16:40pm
   
You think the OP is asking if you can make the drop down list show when focused? Rather than populate when focused?
William Silva at 24-Jun-10 16:51pm
   
with just jQuery its not possible...i think... i tried with xhtmlxCombo but i had problems with AJAX. =(
Sandeep Mewara at 24-Jun-10 17:16pm
   
There were multiple things that can be concluded so i was a little confused, but reading your answer - it looked like you were confident on what OP was asking so was a little curious on how so! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 921
1 OriginalGriff 250
2 Volynsky Alex 205
3 Kishore Pogaru 160
4 Richard Deeming 140
0 OriginalGriff 5,640
1 Sergey Alexandrovich Kryukov 4,693
2 CPallini 4,540
3 George Jonsson 3,132
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 25 Jun 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100