How we can DropdownList Items Expand?

Last post 07-02-2009 2:34 AM by krc. 37 replies.
Page 1 of 3 (38 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 01-09-2009 1:29 PM

    How we can DropdownList Items Expand?

     Hi,

    I have one issue

      Iam using  asp:dropdownlist box   ..  width"150px" 

    dropdownList items lenth(width) is more than 150 px ... 

    I want to expand List items only ...not a  total dropdown..

    Actally asp:dropdown is expanding in firefox , safari  and Google crome etc..(showing results as look like combobox)

    its showing listitems up to whatever item length...(look like combobox)

    But the problem is in IE6 and IE7 only.....(here drop down is not working as look like combobox)

    its not expanind upto item length...(suppose if I set the dropdown width=auto item legh is 500px means page is getting distabance)

     Iam expecting web combobox...(using dropdownlist)

     

    Please verify and let me know....

    Thanks

  •  Advertisement

    Featured Advertisement

     
  • 01-09-2009 1:54 PM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

    in this case, will the following custom-made combox work for you? 

    http://www.codeproject.com/KB/custom-controls/combobox.aspx

     

  • 01-09-2009 2:13 PM In reply to

    Re: How we can DropdownList Items Expand?

     allready I have tried in this control..in my application

    its not working in firefox and other browers...its working only in IE..

    And i triend one more control..scs.web.control also..this is aslso not working properlly...

    Can u plxz give any suggetion....

    at javascript side   can we do anything? element.options...like...

    this post any is helpfull for me?

    //****************strart****************///

    http://dotnetslackers.com/Community/forums/populate-asp.net-dropdownlist-using-javascript/t/2404.aspx

    var ddlDay = $get('ddlDay');

    for(var i = 0; i < 5; i++)

    AddToOptionList(ddlDay, i, i);

     function ClearOptions(OptionList) {

      // Always clear an option list from the last entry to the first
       for (x = OptionList.length; x >= 0; x--) {
          OptionList[x] = null;
       }
    }


    function AddToOptionList(OptionList, OptionValue, OptionText) {
       // Add option to the bottom of the list
       OptionList[OptionList.length] = new Option(OptionText, OptionValue);
    }

     

    //**********ended*****************//
    above link any any helpfull for me ?
    at javascript side can we  ? to expand the list Items....?
    Thanks & Regards
    Ramesh
  • 01-10-2009 12:24 AM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

     this seems to be a long-standing problem. One guy's suggestion is such

    "My suggestion is set a fix size of your DropDownList and display the entire ListItem Text in a Tooltip instead..

    http://www.codeproject.com/KB/aspnet/List_Box_Tool_Tip.aspx "

    As in this forum post in asp .net

    http://forums.asp.net/p/1368912/2854303.aspx#2854303

  • 01-10-2009 1:37 AM In reply to

    Re: How we can DropdownList Items Expand?

    hi

     U mean to say... have only one solution to make the tooltip for dropdown...

    but thire alos one problem...tooltip code doesn't  not support IE6.....

    there is no solution to expand the listItemsText..instead of tooltip?

    ata javascript side:

    <select id="dropDown1" class="dropDownWidth" onMouseOver="checkEvent(this.event);" onMouseOut="checkEvent(this.event);" onMouseMove="checkEvent(this.event);">
     <option value="This is Option 1">Option1</option>
     <option value="This is Option 2">Option2</option>
     <option value="This is Option 3">Option3</option>
    </select>

    can we create on div for options tags...div width =auto;style="display:none || block...

     this senario any helping for me? 

    Thanks

    ramesh

  • 01-10-2009 6:53 AM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

  • 01-10-2009 8:43 AM In reply to

    Re: How we can DropdownList Items Expand?

     Hi,

        I have little bit confution there is no code  for downloading..

       http://www.codeproject.com/KB/combobox/ComboBoxAutoWidth.aspx

       cau u plz provide any sample sorcecode  using above  link

      If I start to work on this it will take long to complete... :)

      so can u plz concentrate on this ..aand provide me a sample code...

     

    Thanks

    ramesh

     

     

  • 01-10-2009 11:41 AM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

    That one does not have downloadable sample, however does have code in the article. 

    To tell the truth, I have no confidence I have a solution for this. Based on my not-so-extensive search, I kind of doubt it is even possible.

    Also, let me phrase your question again, you want a fixed sized dropdown list, yet you want a list item to expand to its full length for readability when selected, is that right?

    Let me know, thanks

  • 01-10-2009 1:11 PM In reply to

    Re: How we can DropdownList Items Expand?

     ya exactly...

    its needs  to be support all the browsers...!

    please verify the bellow link at  Figure 6 -

    Comboboxes Linked through JavaScript

    http://aspalliance.com/686_Review_eBusiness_Applications_Web_ComboBox_Version_3.all

     (or)

    http://www.codeproject.com/KB/combobox/ComboBoxAutoWidth.aspx

    look like above links... 

    BUT controls needs  to be having cross browse comapatibilty....!

    Thanks & regards

    Ramesh

  • 01-12-2009 1:07 PM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

    Lack confidence in myself with regards to this problem, I went on searching again. The following is what I found:

    Okay, this option is pretty hackish but should work.

    $(document).ready( function() {
    $
    ('#select').change( function() {
        $
    ('#hiddenDiv').html( $('#select').val() );
        $
    ('#select').width( $('#hiddenDiv').width() );
     
    }
     
    }

    Which would offcourse require a hidden div.

    <div id="hiddenDiv" style="visibility:hidden"></div>

    ohh and you will need jQuery

    ===================

    Hopefully it helps

  • 01-12-2009 1:15 PM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

  • 01-20-2009 4:38 AM In reply to

    Re: How we can DropdownList Items Expand?

     hi,

    code is  getting confustion...I did'nt get thid code...

    thanks

    ramesh

  • 01-20-2009 8:07 AM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

     Where are you at now?

    I am afraid I have to get back to you tomorrow, pretty tied up today.

  • 01-20-2009 12:53 PM In reply to

    Re: How we can DropdownList Items Expand?

     Hi

        I am in India(Hyderabad)...at globaleprocure pvt ltd...

    Actully same isssues I posted..lot of foums..but...this forum only..I get spontanious responce...particularly..ur responce. ..is good..many many thanks to u... about this forum..I expalined to  friends circle..

    may I know where r  from...:)

    we have to discuss programatically..but...iam discussing..personally..:) sorry for this...

     

    thanks

    ramesh

  • 01-21-2009 10:56 AM In reply to

    • xxXd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: How we can DropdownList Items Expand?

     Thanks for the compliment, I am at Chicago. Nice to meet you online

    With regards to the dropdown list problem, what is your current approach? I think it is a tough problem.  

Page 1 of 3 (38 items) 1 2 3 Next >