Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Hamlet
Posted

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

Hamlet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...