About the Combobox in Datagrid!

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

I have used examples and a class called DataGridComboboxColumn from an
example I found on SyncFusion.

I had to add another Event to get the SelectedIndexChanegd event working but
I did that in the Class... and now I realized I need to get that even from
the form.

How do I add a SelectedIndexChanged handler in the form where I'm using the
DataGridComboBoxColumnn?

/Lars
 
Hi Lars

I added it on the wrong question.

You can try this

In the DataGridComboBox column class you can add
Public Event ComboSelectedIndexChanged()

Than you can make an event in that class for the SelectedIndexChanged which
has the row
RaiseEvent ComboSelecteIndexChanged()

Than in the form you have to make the combobox global (private) withevents,
than you can catch it. I did try it however did not look for side effects, I
saw it fires more than you probably want so that you should prevent too.

I hope this helps?

Cor
 
I'm not as good as you might think I am... I can't compile!

what does this error mean?

" Method 'ComboBoxColumn_SelectedIndexChanged' cannot handle Event
'ComboSelectedIndexChanged' because they do not have the same signature."

/Lars
 
Hi Lars,

Something more complete

In the top of your program under windows designer code this
Private WithEvents cmbTxtCol As DataGridComboBoxColumn

Than you have also to change this sentence with
Dim cmbTxtCol as new DatagridComboboxColumn
to
cmbTxtCol = New DatagridComboboxColumn

Than in the declaration of the Class DatagridComboboxColumn
Public Event ComboSelectedIndexChanged(ByVal _
sender As Object, ByVal e As System.EventArgs)

And before the end of that class (not the nokeyupcombo class)

Private Sub ColumnComboBox_SelectedIndexChanged _
(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ColumnComboBox.SelectedIndexChanged
RaiseEvent ComboSelectedIndexChanged(sender, e)
End Sub

And than you can add the event in your program by choosing it from the
comboboxes.
(It still is a quick and dirty solution)

I hope this helps

Cor
 
Back
Top