Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Touble in Combobox
Message
From
24/10/2005 14:02:36
 
 
To
24/10/2005 05:33:25
Glenwell Andal
Pdc Software Philippines
Quezon, Philippines
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01061548
Message ID:
01061648
Views:
14
Glen,

I'm not sure why you're using the Click event of a ComboBox to populate itself ... you should be populating the ComboBox with DataBinding in either the Constructor or the Load event of your form/control. Try something like this:
cboFloorNumber.DataSource = m_oDataManagement.OleDataSet.Tables(0)
cboFloorNumber.DisplayMember = "ColumnToDisplay"
cboFloorNumber.ValueMember = "ColumnWithValue"
~~Bonnie


>I encounter a problem in using combox to the event "Click". Supposed that i had a dataset, i want to populate my comboBox with the column(0) of dataset. It is working but it has a little problem. "I the first Click_Event the data was not shown"(error). But in the next Click event its working. Here is my code:
>
>
>Private Sub cboFloorNumber_Click(ByVal sender As Object, ByVal e As System.EventArgs)
>            Handles cboFloorNumber.Click
>   Dim i As Integer
>   cboFloorNumber.Items.Clear
>   For i = 0 To m_oDataManagement.OleDataSet.Tables(0).Rows.Count - 1
>      cboFloorNumber.Items.Add(m_oDataManagement.OleDataSet.Tables   ("UnitInformation").Rows(i)(0))
>
>   Next
>End Sub
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform