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

DataGridViewComboBox

I'm trying to set the value of a combo box in an unbound DataGridView.

Some code is as follows.

Dim dgr As New DataGridViewRow
dgr.CreateCells(grdBuildingComponents) 'set row with design time column
structure

dgr.Cells(0).Value = dr(0)
dgr.Cells(1).Value = rowcount
dgr.cells(2).value = ?

....where dgr.cells(2) is defined as a combobox through the designer.

How do i set the value of the combo and get the text to display?
Also, when changed, how do I retrieve the value of the combo?

Basic stuff I'm sure but this has me a bit stumped...
Dec 15 '06 #1
1 1276
Juzzy,

It seems that you are using a datarow, wherefore dr stends in a way as it is
not described. Than why do you want to use an unbound datagrid. At least I
will never do it and put not any minute in it how to do that.

Cor

"juzzy" <ju***@discussions.microsoft.comschreef in bericht
news:4D**********************************@microsof t.com...
I'm trying to set the value of a combo box in an unbound DataGridView.

Some code is as follows.

Dim dgr As New DataGridViewRow
dgr.CreateCells(grdBuildingComponents) 'set row with design time column
structure

dgr.Cells(0).Value = dr(0)
dgr.Cells(1).Value = rowcount
dgr.cells(2).value = ?

...where dgr.cells(2) is defined as a combobox through the designer.

How do i set the value of the combo and get the text to display?
Also, when changed, how do I retrieve the value of the combo?

Basic stuff I'm sure but this has me a bit stumped...

Dec 15 '06 #2

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

Similar topics

2
by: dimension | last post by:
Hi, i have one question and one opinion i seek. please assist if you can. I am using VS2005 beta. 1) I have two tables with the following columns Security: security_id, name, symbol, exchange_id...
1
by: perspolis | last post by:
Hi All I used datagridviewcombostyle for my application.. but it shows the combobox style in DropDownList style..I want to be able to enter data into it,,how can I have combobox dropdown ?? ...
1
by: ashok76 | last post by:
Hi I've a DataGridView and where has column 0 is a DataGridViewComboBoxColumn Whenever I selected that cell then the drop down list not appeared on single click event hence I need to click again...
1
by: tim8w via DotNetMonster.com | last post by:
I am using a DataGridViewComboBox in a DataGridView. When a user selects a radio button, I would like to clear all the items in the DataGridViewComboBox and repopulate with new values. I do this as...
0
by: DominicHelen | last post by:
I am doing c# .net windows application. I have three forms which are load one by one using : Thread t = new Thread(new ThreadStart(StartInterviewThread)); t.start(); public void...
3
by: DominicHelen | last post by:
I have used this following: private void EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { DataGridViewComboBoxEditingControl cbo = e.Control as...
0
by: DominicHelen | last post by:
I have a datagridviewcomboboxcolumn with that I can type a new value which is not in the drop down list. But I can not type a value which is in the list with keyboard. I can only scroll down to...
0
by: gotonagle | last post by:
Hi i am working in vb.net with datagridview. the problem is if i set the EditMode property of datagrid to "EditOnKeyStrokeOrF2" then to select the dropdown we have to click three times on it and if...
2
by: arevans | last post by:
I have a datagridview with two comboboxcolumns. I want the combobox in column B to be dynamically filled with data from the database depending on which item is selected in column A. How do I go...
1
Plater
by: Plater | last post by:
I feel like this question has been asked before, but I couldn't find it. I think I am missing something obvious. Basically I am going to have a DataGridView with two columns. One textbox, one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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.