DataGridView.DragDrop Event Handler Causes a DataError? (May be a Bug?!?!?!)

L

Leon_Amirreza

Hi
A DataGridView is Bound to a bindingSource that in turn is bound to a Table
in a TypedDataSet
When I Add Records to the the DataTable in DragDrop EventHandler it causes
DataGridView to Add an Empty Dummy Record at the end that causes to produce
an error (because one of the fields in the record must not be null)?!

Is It a Bug?

I am using .Net 3.5 on Vista SP1
 
L

Leon_Amirreza

Actually the (* row) makes this problem. when the user clicks the star row
to add a new row without typing anything insisde it, the DGV does not go to
editing mode. then adding rows to DataSet programatically (like a drag drop
event that adds rows; or a timer that adds rows in its event handler) causes
* row to remain now if the user navigates away from that empty * star row,
the DGV error dialog box appears.
 
C

Cor Ligthert[MVP]

Lenon,

I don't know the problem, but you can probably use the EndCurrentEdit on the
bindingsource to fake an enter.

Cor
 
L

Leon_Amirreza

I used BindingSource.CancelEdit() but it doesnt revoke newly added row (or *
row which is empty because user has not typed in it so the DGV is not in
edit mode)
What to Do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top