Datagrid & Combobox Dataaset updataing problem

donnacha

Centurion
Joined
Feb 27, 2003
Messages
187
Hi folks,
I have a weird problem when I am using a datagridcomboboxcolumn. In my grid I have several columns one of which is a combobox.
When I enter data (1st entry for a new row) in any of the columns other than the combobox column, a new row is created in the grid and datasource. When I enter date in the combobol column as the 1st entry for a new row, the data is accepted and appears in the grid, but no new row is created in the datagrid/dataset.

Has anybody come across anything like this before.

Am I failing to handle some event ?

I am using VS 2000 and VB. The combox box is a derived class, I have tried it out with a variety of samples and I get the sam result each time.

Any help would be great.
 
Hi folks,
I found the solution, apparently the problem has nothing to do with the derived class, it lies instead with the datagrid.

The solution is thanks to
http://www.error-bank.com/microsoft.public.dotnet.languages.vb.controls/4644_Thread.aspx

(why could't I have found that a month ago, oh the pain, the pain....)

Private Sub MainGrid_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainGrid.CurrentCellChanged
Me.BindingContext(MainGrid.DataSource, MainGrid.DataMember).EndCurrentEdit()
End Sub
 
Back
Top