Well actually... I think I fixed it..
In the DataGridComboColumnStyle Class I added this
Public Event ColumnComboBoxSelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
....and then in the Event that has the SetColumnValueAtRow (which is ComboChanged) I Raised that event..
...and then, in the Form Class, when setting the properties for this style and adding it to the DataGridTableStyle I added a handler
'COMBOBOX
Dim statestyle As New DataGridComboColumnStyle(ds.Tables("States"), "State", "State")
statestyle.MappingName = "State"
statestyle.HeaderText = "States"
ts.GridColumnStyles.Add(statestyle)
AddHandler countrystyle.ColumnComboBoxSelectedIndexChanged, AddressOf ColumnComboBox_SelectedIndexChanged
And then
Public Sub ColumnComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
MsgBox(CType(sender, DataGridCombo).SelectedValue)
End Sub
Which Worked fine:) Then I can take that Value and search for a Row in the ComboBox Source and then grab whatever mpre fields I need and add to the cells on the same row in the grid
This wouldn't give me any problems later on or?
/Lars Netzel
"Lars Netzel" <ui****@adf.se> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl...
What I want to achieve is to change the Item in the Combobox in a column and
then fill in a bunch of data in the textcells on the same row.
Like this..
3 columns in the Grid (Product, Price, Description)
I the first I have a Combobox column and the Combobox is flled with
Productnames and when I select one I want the Price and Description for that
product to be automatically filled to the rest of the column on that row.
/Lars
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:e%****************@tk2msftngp13.phx.gbl... Lars,
That seems for me to become very complex. What you want to do with that
event.
As it is, is it just place the data (or as I remember me the value with
the extended column version) in the row .
You never can catch a single item change in a datagrid.
Cor