dcsimg
Results 1 to 5 of 5

Thread: text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2018
    Posts
    25

    Question text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

    Hello

    i use from ajaxcontroltoolkit for a combobox.
    for search sometimes i nead to cleat text property of my combobox until search method return all record (without filter)
    but the command (mycombobox.text = "") dont work. why?

    Thanks

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,625

    Re: text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

    Haven't worked with asp.net combo for a looong time but I'm guessing that you need to clear the items of the combobox. Clearing like you do so looks to me that it clears the name of the control.
    So something like mycombobox.item(0).text ="" look like more sufficient.
    Slow as hell.

  3. #3
    Member
    Join Date
    Jul 2019
    Location
    Ahmedabad
    Posts
    32

    Re: text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

    Hi @armm1388,

    Try using
    Code:
    mycombobox.SelectedIndex=-1
    or
    Code:
    mycombobox.Items.Clear();

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,726

    Re: text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

    setting the .Text doesn't clear the selection... setting .SelectionIndex to -1 will...
    .Items.Clear will clear out all items from the combobox... I don't think that's really what you want... start by setting .SelectedIndex = -1 first... see if that gets you the desiref effect.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,625

    Re: text property of combobox (of Ajaxcontroltoolkit ) don't be clear.

    @Tech.
    It's a 2018 post
    Slow as hell.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width