Results 1 to 5 of 5

Thread: Visual Studio Express: Delete data in a combobox

  1. #1
    Join Date
    Sep 2010
    Posts
    16

    Visual Studio Express: Delete data in a combobox

    Hello how do I delete what is written in a combobox when in DropDownList.? When the DropDown is used combobox.text = "" as serious DropDownList is the same way or is another.? I am not that expert in Visual Studio Express, so thought to take some help from you members. I have also tried many different methods to do it, but I was not successful. I am able to delete the entries from simple options, but not in the combo-box. Please help me by providing some proper solutions. Any other information related to the subject would also be grateful.

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: Visual Studio Express: Delete data in a combobox

    Hello as I erase the writing in a combobox when in DropDownList. When the DropDown is used combobox.text = "" as serious DropDownList is the same way or is another. Well the closest thing you could use the Clear method I explain how to use.. For a DropDowList can use the following:
    Code:
    this.DropDownList1.Items.Clear ();
    I hope that you will definitely get the help that you were looking for.

  3. #3
    Join Date
    Oct 2008
    Posts
    167

    Re: Visual Studio Express: Delete data in a combobox

    It really depends on whether the data bound this control or not. But for this out there need to preserve the original dataset in Session, so look for the item and delete it. If you've added in code, or the Items.Add () would remove directory:
    Code:
    DropDownList1.Remove (DropDownlist1.SeletedItem) 
    
    or else 
    
    DropDownList1.RemoveAt (DropDownlist1.SeletedIndex)
    Utilize the remove method to eliminate a ListItem from the collection. Implementation of the method this takes the ListItem Specified by the item parameter and detached it from the collection.

  4. #4
    Join Date
    Mar 2008
    Posts
    227

    Re: Visual Studio Express: Delete data in a combobox

    I am providing an example for ListItemCollection. Remove Method (ListItem) that is used in VB. I am sure that you will get some hint from it. The following exhibit the code illustration creating ListItemCollection objects, toting up items to the collections, and removing items from the anthologies. In the example, the ListItemCollection named listBoxData is bought into play as the data source for a ListBox control ListBox1 Called, and the ListItemCollection Called ddBoxData is used as the data source for a DropDownList control called DropDownList1.
    Code:
    'Add the selected item to DropDownList1.
     DropDownListA.Items.Add (ListBoxA.SelectedItem)
     'Delete the selected item from ListBoxA.
     ListBoxA.Items.Remove (ListBoxA.SelectedItem)

  5. #5
    Join Date
    Jan 2009
    Posts
    140

    Re: Visual Studio Express: Delete data in a combobox

    There are two ways to do that are :
    • Static
    • Dynamic
    Static: is that the values are listed, the project will not change.
    Dynamics: is values that are listed, the project varies. An Example of Static:
    It may be that you fill out a cambox an Array List <> or Manuel and Dynamic: when the cambox is filled with a field of database.

Similar Threads

  1. Replies: 2
    Last Post: 16-02-2011, 02:49 PM
  2. error in Data Source Configuration Wizard in Visual Studio 2008
    By BlackRedRobin in forum Software Development
    Replies: 2
    Last Post: 31-05-2010, 11:29 AM
  3. Compare Visual Studio 2010 and Visual Web Developer Express
    By Zacharia in forum Software Development
    Replies: 5
    Last Post: 28-01-2010, 04:27 AM
  4. System.Data.DataRowView in combobox
    By ArunJ in forum Software Development
    Replies: 4
    Last Post: 01-10-2009, 09:21 PM
  5. Difference between Visual studio 2005 and Visual studio 2008
    By RohanS in forum Software Development
    Replies: 3
    Last Post: 12-06-2009, 10:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,454,081.86419 seconds with 17 queries