473,395 Members | 1,688 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.

Fill Combobox with DV

ken
I would like to fill a combobox with the values of one
column of the dataview I am using. When I set it up the
way I expect it would be, I get every row in the combobox
says: System.Data.DataRowView

If I click on one, it navigates to the right place. Any
idea how I would get the System.Data.DataRowView to show
the actual values in the column?

Thanks
Nov 20 '05 #1
2 1204
Cor
Hi Ken,

I send bellow some code to fill a complete combobox with a datatable and a
dataset.

What you tell can also come, because of that the index change event is fired
every time that the combobox is loaded and you are looking to a still empty
combobox.

To avoid that, you can set a "switch", "boolean" that you set to true in the
load event and thant test that in the selectedindexchanged event.

This is some code to fill a combobox
\\\
Dim dt As New DataTable
Dim dc As New DataColumn
Dim dr As DataRow
dc.DataType = System.Type.GetType("System.String")
dc.ColumnName = "i"
dt.Columns.Add(dc)
For i = 1 To 10
dr = dt.NewRow()
dr("i") = (i * 10).ToString
dt.Rows.Add(dr)
Next i
Dim dv As DataView = New DataView(dt)
dv.Sort = "i DESC"
Me.ComboBox2.DisplayMember = "i"
Me.ComboBox2.DataSource = dv
Me.ComboBox2.SelectedIndex = 5
///

Nov 20 '05 #2
Cor
I send bellow some code to fill a complete combobox with a datatable and a
dataset.

dataview
Nov 20 '05 #3

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

Similar topics

8
by: Pepehammer | last post by:
Hi everybody! I got a combobox to fill. I want to display some information (Text), but when I select a item, I want to return a number. The info I want to fill in is something like this: ...
1
by: Ari | last post by:
Hi I hope some body can help me. I'm new with Visual Basic .net. I'm trying to fill a DataSet from to combo box but i do not how to do and i do not find any information that expalin to me how to...
1
by: Maurice Mertens | last post by:
Does anyone know how to get an auto-filling combobox on a form? When I add a combobox to a form I can set the DropDownStyle property to DropDownList. This will make the combobox auto-filling. But...
3
by: Maurice Mertens | last post by:
Hi all, In VB.NET you can set the DropDownStyle for a combobox to 'DropDown' or 'DropDownList'. When you set it to DropDownList, it supports auto-fill. But when you set it to 'DropDown', the...
7
by: sparkle | last post by:
Hi Everybody, I'm filling a combobox from a class, which works fine on it's own. But when I insert code to fill in other controls something in the combobox fill is causing the...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
5
by: Tark Siala | last post by:
hi dear i'm programmer with VB6, but now i starting with C#. first problem is coming when i need fill "ComboBox Control", as you know when i fill combobox in VB6 by this code: comboX.AddItem...
2
by: tshad | last post by:
In my VS 2003 Windows Forms page, when I initially fill my ComboBox (SystemList), it goes to the SelectedIndexChanged event which calls the Loademails() function. I then call it again in the...
1
by: menyki | last post by:
am still finding it difficult as a new java user. am designing a software that has multiple forms, controls such as combobox and so on and finding it difficult to do the following. i want some...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.