473,394 Members | 1,845 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,394 software developers and data experts.

Returning the value of a Datagrid ComboBox

Hi Guys,

I have a form setup with a Datagrid. The Datagrid has a combobox in one
column. I am trying to find out the value of the combobox after it has been
changed.

I have added a handler for the SelectIndexChanged event to the TableStyles
Class as follows:-

AddHandler ComboTextCol.ColumnComboBox.SelectedIndexChanged, AddressOf
ItemComboBox_SelectedIndexChanged

The event fires the following:-

Private Sub ItemComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs)

Dim cbo As NoKeyUpCombo = New NoKeyUpCombo

Dim SelectedIndex As Integer = cbo.SelectedValue

MessageBox.Show("Col is " & DataGrid1.CurrentCell.ColumnNumber _

& ", Row is " & DataGrid1.CurrentCell.RowNumber _

& ", Value is " & cbo.Text)

End Sub

Any ideas on what I need to do?

Cheers

Peter.


Nov 21 '05 #1
1 1226
Sorry forgot to say that the message box returns the Row and Col data but no
value!

Cheers

Peter.
"Peter W Johnson" <vk****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Guys,

I have a form setup with a Datagrid. The Datagrid has a combobox in one
column. I am trying to find out the value of the combobox after it has
been changed.

I have added a handler for the SelectIndexChanged event to the TableStyles
Class as follows:-

AddHandler ComboTextCol.ColumnComboBox.SelectedIndexChanged, AddressOf
ItemComboBox_SelectedIndexChanged

The event fires the following:-

Private Sub ItemComboBox_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs)

Dim cbo As NoKeyUpCombo = New NoKeyUpCombo

Dim SelectedIndex As Integer = cbo.SelectedValue

MessageBox.Show("Col is " & DataGrid1.CurrentCell.ColumnNumber _

& ", Row is " & DataGrid1.CurrentCell.RowNumber _

& ", Value is " & cbo.Text)

End Sub

Any ideas on what I need to do?

Cheers

Peter.

Nov 21 '05 #2

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

Similar topics

2
by: Bill C. | last post by:
Hi, I'm trying to implement a ComboBox drop-down column for a DataGrid. When a cell is selected in the ComboBox column I overlay a ComboBox over the cell and call: this.comboBox.Show();...
2
by: Robert | last post by:
I'm sure this is a fairly basic question, but I've been looking all over the web for days for suggestions on how to do this. I've got a datagrid that's bound to a dataset on my form. It includes...
0
by: Johann Blake | last post by:
I have a dataset that I bind to two different datagrids. The dataset contains 2 tables. One is the main table used to store what I call session data which includes a Country field where the ID of a...
3
by: Doug | last post by:
Hi I have the following code (not mine) that populates a datagrid with some file names. But I want to replace the datagrid with a combo box. private void OnCurrentDataCellChanged(object sender,...
5
by: jaYPee | last post by:
i have successfully added a combobox to my datagrid by setting their datasource from one of my table. here's my code... Dim grdColStyle6 As New DataGridComboBoxColumn() With grdColStyle6...
0
by: zhuang | last post by:
Hi, Adding combobox to datagrid has been posted many times. I have a datagrid which has multiple combobox columns and normal textbox columns. But how could I change other combo box values at...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
1
by: sathyan8294 | last post by:
i am using dotnet 2003.i am doing my project in vb.net windows application.i have two form in my project.first form is datagrid .In second form label,textboxes and combobox are avilable to save the...
0
by: mansoorali | last post by:
hi, am using hittest class in parent form for datagrid and 1 value to be retreived in child form for combobox when i click grid in parent form, am getting the 0 index value by default perhaps i want...
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
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
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.