By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,033 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,033 IT Pros & Developers. It's quick & easy.

Returning the value of a Datagrid ComboBox

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.