473,397 Members | 2,099 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,397 software developers and data experts.

C# Windows Form Databound Listbox Problem - Help!!

I have developed a Windows Forms application with C#. On the windows
form I have a master list box with the names of people the user can
select from and when selected it calls a Select in SQL server to gather
the appropriate information. It is then populated onto a multi-tab
portion on the right of the screen. On the 3rd tab I have 2
multi-select listboxes. The problem is on the first time I go to the
tab for the first name the 2 multi-select listboxes are not highlighting
the items that should be. If the user selects another name then
reselects the first one, it works okay. I can not figure out why it is
not highlighting on the first time????? I have tried doing refreshes
on the controls when I load the data. I have tried refreshing the tabs
too. Nothing seems to work. It is like it lost context the first time.
I am about ready to pull out the few hairs on my head. Any help would
greatly be appreciated.

Thanks,
Wade Beasley


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
1 2037
after you filled the listbox containing the names did you try setting the
selection explicitlly like this for example:

fillNamesListBox();
myListBox.SelectedItem = 0;
"Wade Beasley" <wa**********@insightbb.com> a écrit dans le message de news:
OH**************@TK2MSFTNGP11.phx.gbl...
I have developed a Windows Forms application with C#. On the windows
form I have a master list box with the names of people the user can
select from and when selected it calls a Select in SQL server to gather
the appropriate information. It is then populated onto a multi-tab
portion on the right of the screen. On the 3rd tab I have 2
multi-select listboxes. The problem is on the first time I go to the
tab for the first name the 2 multi-select listboxes are not highlighting
the items that should be. If the user selects another name then
reselects the first one, it works okay. I can not figure out why it is
not highlighting on the first time????? I have tried doing refreshes
on the controls when I load the data. I have tried refreshing the tabs
too. Nothing seems to work. It is like it lost context the first time.
I am about ready to pull out the few hairs on my head. Any help would
greatly be appreciated.

Thanks,
Wade Beasley


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2

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

Similar topics

0
by: JB | last post by:
I have a databound listbox that is causing my form to hang when I call the show method. The list box is bound using the following code: _dataView.Table = _data.Tables; lboUsers.DataSource =...
2
by: anastasia | last post by:
I have the following code (this is a snippet): InitDBConn(); OpenDBConnection(); OleDbCommand cmdRidge = new OleDbCommand("SELECT * FROM TRDRidgeTypes", oleDbConn); OleDbDataReader...
0
by: Ken Varn | last post by:
I have a strange problem with a databound listbox. It may be because of how I use it, but I am stumped by this behavior. Here is the scenario: I have a multiselect databound listbox that...
9
by: Justin Engelman | last post by:
Hi, I have a website that uses an ISAPI filter that will redirect anyone going to any page on the site to an SSL login page (on a different website with the same root domain) if they do not have...
3
by: Jason Huang | last post by:
Hi, Would someone tell me how to get a MenuItem's Name in a C# Windows Form? Thanks for help. Jason
3
by: karthi84 | last post by:
hi, can any one help me in adding check box to a data grid in windows form. if possible help me with c#.
6
by: =?Utf-8?B?SnVzdGlu?= | last post by:
Hello: Does anyone know how I can create a multi-column listbox in VB.Net (Windows)...I am using VS.Net 2003. If there is another control available that can be databound with multiple...
0
by: silentcacophony | last post by:
hello i need some help.. I am creating an application where a button is added in the outlook tool bar . Now when i select this button . it should open a windows form showing the selected the...
2
by: deccio | last post by:
I have create an activex Control with Visual studio 2005 and framework 2.0 in c# to add drag & drop functionality to upload multi file. When I use it in a windows form it work fine. Infact if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
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,...
0
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...

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.