Handling the RowDeleted event of a datatable

C

Cesar Ronchese

Hi All.

I'm printing the contents of a datatable in my control, and actually it is
working well. My problem is when a row is deleted from the datatable, which
fires the RowDeleted event and, inside this event, I try automatically
redraw my control.

What I have noticed is, after RowDeleted event is fired, the row is not
deleted, just the RowState is changed to deleted. And, looking for tasks in
my code, I really need that row be completely removed from the datatable
before I can redraw my control.

Is possible I change the default behaviour, to truly remove the row when
firing RowDeleted event?

Cesar
 
C

Cesar Ronchese

Apparently, now is resolved..

I noticed the following:

1. datatables filled via code was already working in the right way.
2. datatables filled via DataAdapter was doing that problem (doesn't
decrement the Rowcount).

Anyways, I called Datatable.AcceptChanges( ) and the row is finally
decremented for that second case, although I lost my cache for an eventual
RejectChanges( ).

[]s
Cesar






"Cesar Ronchese" <ronchese*smlinfo.com.br> wrote in message
Hi All.

I'm printing the contents of a datatable in my control, and actually it is
working well. My problem is when a row is deleted from the datatable, which
fires the RowDeleted event and, inside this event, I try automatically
redraw my control.

What I have noticed is, after RowDeleted event is fired, the row is not
deleted, just the RowState is changed to deleted. And, looking for tasks in
my code, I really need that row be completely removed from the datatable
before I can redraw my control.

Is possible I change the default behaviour, to truly remove the row when
firing RowDeleted event?

Cesar
 
C

Cor Ligthert [MVP]

Cesar,

You can have a look at my explanation of this behaviour at Zorpiedoman which
I have sent and which is about 9 hours later (up) in this newsgroup.

Cor
 

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