473,785 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to clean all itens in a Combobox list???

Hi i need some help to solve a problem with the DataSource
in a COMBOBOX.
The question is "How can i clear all the itens in a
Combobox if i use the DataSource to browse data in a
database????".
I use the code below to fill a combobox:

this.cboSubfami lia.DataSource = thisDataSet.Tab les
["subfamilia "];
this.cboSubfami lia.DisplayMemb er = "subfamilia ";

After to make the described one above, as I can clean all
itens of same combobox and does not appear nothing in its
listing???

Nov 15 '05 #1
2 11191
Thomaz,

You should be able to remove the data source and it should remove the
items from the combobox.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

"Thomaz" <su***@nce.ufrj .br> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi i need some help to solve a problem with the DataSource
in a COMBOBOX.
The question is "How can i clear all the itens in a
Combobox if i use the DataSource to browse data in a
database????".
I use the code below to fill a combobox:

this.cboSubfami lia.DataSource = thisDataSet.Tab les
["subfamilia "];
this.cboSubfami lia.DisplayMemb er = "subfamilia ";

After to make the described one above, as I can clean all
itens of same combobox and does not appear nothing in its
listing???

Nov 15 '05 #2
On Tue, 2 Sep 2003 14:31:30 -0400, "Nicholas Paldino [.NET/C# MVP]"
<ni************ **@exisconsulti ng.com> wrote:
Thomaz,

You should be able to remove the data source and it should remove the
items from the combobox.


TO be sure, you can always:
myComboBox.Item s.Clear();

--
NULL
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
23530
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking for a match between cVal and the selectedValue then stop when I do have a match the obvious problem is that each iteration fires the selectedIndexChanged but also for a large list this will slow everything down. There must be a better way int...
1
1415
by: Marco Roberto | last post by:
Hi, is there anyway to add itens into a combobox after this control be bound with a dataset? Regards, Marco
0
1091
by: Evandro Klen S. Azeredo | last post by:
Hi, I'm with the folowing problem: I have two tables: header(id_header) and Itens(id_header, id_item). When I insert data in Itens table, this error is returned: "You cannot add or change a record because a related record is required in table 'header'." I'm using MS Access database.
1
5066
by: vehuel | last post by:
I have a select multiple (combobox) in a form and I need to select, using javascript, more than one item in this select. How can I do this?
6
10822
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I modify the Items collection to be {two,one,three} and now want "two" to appear in the combobox text. However, the combobox text is now blank. the is apparently somehow the result of having changed the combobox.Items collection. If, trying to fix...
19
2209
by: active | last post by:
I'm using a ComboBox to display objects of a class I've defined, say CQQ. Works great except somehow I occasionally set an Item to a String object instead of an object of type CQQ. It looks like Text replaces an item or something like that. This results in a runtime error at which time I learn that the item that should be CQQ is a String.
4
6666
by: Jerad Rose | last post by:
I'm baffled by this -- is there not a typed object used for ComboBox Items? Best I can tell, all of the methods for ComboBox that accept an Item are of type Object. Why in the world is a common/standard .NET control accepting an Object as a parameter type? In Web Forms, there is a ListItem object that can be passed in to add/retrieve objects from a DropDownItems collection. I searched Google groups, and all the solutions I'm finding...
19
4756
by: billa856 | last post by:
Hi, I have to use the table(PRODUCTION) already generated in MS Access in which all fields are of TEXT type.fields like (orderdate,palletno,customercode,itemno,pono,carto n,pcs,totalquantity)Now i have already some data in table like 6000 rows.Now in that some fields are blank. Now I have created one Form in MS Access in which there are three ComboBoxes.1st one is independent,2nd one is dependent on 1st one and,3rd one is dependent on both...
1
4255
by: Andrus | last post by:
I need to enter null value from combobox to business object property. My combobox datasource does not contain ValueMember with null value. So I tried to create combobox which stores null to bound object when text is deleted. However bound object contains old value in this case. To reproduce: 1. Run code
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.