By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

How to stop RowChanging events from firing on fill

P: n/a
I just realized the DataTable_RowChanging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to
do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
You can't stop an inherit event like that from firing... you can only "not
handle" it...
"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
I just realized the DataTable_RowChanging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise

Nov 20 '05 #2

P: n/a
Denise,

Not sure why this is happening. I am now assuming that you are doing some
processing in this event that you do not want to happen when the DataAdapter
is being filled. If this is the case then you can handle this in a couple
of ways I can think of:

(1) Define a class level variable call bLoading. Before you call the fill
method set bLoading=True and then set it to False after the fill method. In
the event RowChanging only process if bLoading=False

(2) Do not let VB.NET define the event handler for RowChanging (remove the
handles part of the method declaration) then use a combo of RemoveHandler
and AddHandler before and after the fill method.

Dan

"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
I just realized the DataTable_RowChanging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise

Nov 20 '05 #3

P: n/a
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can only
"not handle" it...
"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
I just realized the DataTable_RowChanging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #4

P: n/a
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can only
"not handle" it...
"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
I just realized the DataTable_RowChanging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

Nov 20 '05 #5

P: n/a
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:On**************@TK2MSFTNGP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can
only "not handle" it...
"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
I just realized the DataTable_RowChanging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #6

P: n/a
sp? = "is this the correct spelling? I really don't know, but I don't want
to look like a jacka$$"

hows that work for ya.

=)

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:On**************@TK2MSFTNGP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can
only "not handle" it...
"Denise" <we******@indy.rr.com> wrote in message
news:bS****************@fe1.columbus.rr.com...
> I just realized the DataTable_RowChanging events were firing when I
> called Fill method of the DataAdapter! It fires TWICE for each row
> loaded. I thought these were only supposed to be called when data
> was actually being edited.
>
> I am using bound textbox controls on the form. Could that have
> anything to do with it? Does anyone know how to stop the
> RowChanging events from firing?
>
> Thanks!
> Denise

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

Nov 20 '05 #7

P: n/a
OK, Now I understand and its me thats the Jackass !
CJ Taylor wrote:
sp? = "is this the correct spelling? I really don't know, but I
don't want to look like a jacka$$"

hows that work for ya.

=)

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:uR**************@TK2MSFTNGP09.phx.gbl...
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:On**************@TK2MSFTNGP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
> You can't stop an inherit event like that from firing... you can
> only "not handle" it...
>
>
> "Denise" <we******@indy.rr.com> wrote in message
> news:bS****************@fe1.columbus.rr.com...
>> I just realized the DataTable_RowChanging events were firing
>> when I called Fill method of the DataAdapter! It fires TWICE
>> for each row loaded. I thought these were only supposed to be
>> called when data was actually being edited.
>>
>> I am using bound textbox controls on the form. Could that have
>> anything to do with it? Does anyone know how to stop the
>> RowChanging events from firing?
>>
>> Thanks!
>> Denise

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.