473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

changing the behaviour of setting the DataSource property

I'm trying to change the behaviour of setting the DataSource property
of combobox.

Here is the behaviour I now see.

Setting the DataSource property of combobox to an ArrayList will visual
display
the first value in the Text field of the combobox. ( or setting the
Text property ).

I don't want this to happen. Just load the DataSource, don't change the
Text property.

Any Ideas

Dec 22 '06 #1
1 1729
Bind the datasource in the normal way, set the Selected index to -1 THEN
subscribe the eventhandler to the SelectedIndexChanged event (or whichever
event you are using):

combobox.DataSource = MyDataSource;
combobox.DisplayMember = "aaa";
combobox.ValueMember = "aaa";
combobox.SelectedIndex = -1;
combobox.SelectedIndexChanged += new
EventHandler(combobox_SelectedIndexChanged);
"progressdll" <ie*****@mail.bewrote in message
news:11*********************@a3g2000cwd.googlegrou ps.com...
I'm trying to change the behaviour of setting the DataSource property
of combobox.

Here is the behaviour I now see.

Setting the DataSource property of combobox to an ArrayList will visual
display
the first value in the Text field of the combobox. ( or setting the
Text property ).

I don't want this to happen. Just load the DataSource, don't change the
Text property.

Any Ideas

Dec 22 '06 #2

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

Similar topics

2
by: TF | last post by:
hi, i am using a ListBox control on a windows form using VB.Net. when i set the DataSource property of the control to an ArrayList it fires following events in this order: SelectedIndexChanged...
2
by: Gidi | last post by:
hello, i'm writing a windows application in C#. i have a dataGrid that takes data from dataset that connected to sql stored procedure, and i have few radio buttons. i want that when ever the...
1
by: Shawn Benson | last post by:
I have a Windows form where a user enters an order number which returns a dataset that is bound to a datagrid. The problem is when a user clicks on a cell in the datagrid, then enters another...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
0
by: David J | last post by:
Hi, I am strugling with the propertygrid and a listbox. I am using the universaldropdowneditor from the codeproject (code below). However I am populating the listbox via a datasource. The problem...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
1
by: Nathan Sokalski | last post by:
I am trying to set the CommandArgument property of a Button control from a template in a DataList of mine using code in the ItemDataBound event. However, it does not want to set the property (it is...
3
by: tshad | last post by:
I have a page with 2 Tabbed Pages on them (TabPage1, TabPage2). I am on TabPage1 and when selecting something on the page I am displaying information on TabPage2 and then want to go to TabPage2,...
5
by: Crazy Cat | last post by:
Hi all, I have combobox that is bound to a custom object collection thusly Dim collection As List(Of StructureType) = StructureType.FindStructureTypes(SharedObjects.StructureTypes,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.