Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 02-26-2009   #1 (permalink)
Leon_Amirreza


 
 

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

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


My System SpecsSystem Spec
Old 02-27-2009   #2 (permalink)
Leon_Amirreza


 
 

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

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.

"Leon_Amirreza" <r_rahmaty@xxxxxx> wrote in message
news:u0icHtDmJHA.3380@xxxxxx
Quote:

> 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
My System SpecsSystem Spec
Old 02-27-2009   #3 (permalink)
Cor Ligthert[MVP]


 
 

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

Lenon,

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

Cor

"Leon_Amirreza" <r_rahmaty@xxxxxx> wrote in message
news:eNjbG8JmJHA.5028@xxxxxx
Quote:

> 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.
>
> "Leon_Amirreza" <r_rahmaty@xxxxxx> wrote in message
> news:u0icHtDmJHA.3380@xxxxxx
Quote:

>> 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
>
My System SpecsSystem Spec
Old 02-27-2009   #4 (permalink)
Leon_Amirreza


 
 

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

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?

"Cor Ligthert[MVP]" <Notmyfirstname@xxxxxx> wrote in message
news:OVocYoLmJHA.4540@xxxxxx
Quote:

> Lenon,
>
> I don't know the problem, but you can probably use the EndCurrentEdit on
> the bindingsource to fake an enter.
>
> Cor
>
> "Leon_Amirreza" <r_rahmaty@xxxxxx> wrote in message
> news:eNjbG8JmJHA.5028@xxxxxx
Quote:

>> 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.
>>
>> "Leon_Amirreza" <r_rahmaty@xxxxxx> wrote in message
>> news:u0icHtDmJHA.3380@xxxxxx
Quote:

>>> 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
>>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Add Event Handler to dynamic DropDownList?????? .NET General
Questions about delegate and event handler .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46