473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to stop RowChanging events from firing on fill

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
7 4552
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
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
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
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
(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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: J | last post by:
I'm experimenting with strongly typed datasets, and when the .Fill method is called, the RowChanging fires for each row. This causes a problem when the existing data does not adhere to the rules...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
3
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace...
1
by: Ahmet Gunes | last post by:
Hi all, I check whether session is alive in Page_Load. If session is not alive then I want to navigate to another page, most probably the login page. But when a control, a button for...
1
by: AH | last post by:
Hi, I used a dataTable to bind to datagrid. I setup code to handle the rowchanging event but whenever I change from one row to another in the datagrid, the datagrid changed to a white box with a...
0
by: Denise | last post by:
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...
0
by: Randy | last post by:
I have various events on my web form, button clicks, checkboxlist index changes, etc. In the course of testing sometimes they stop working (locally). But then if I double click on them (which me...
3
by: mark4asp | last post by:
How can I stop my Calendar control from firing the form validation events? I have a form containing several controls which have several validation controls each. One control is a TextBox...
8
by: Greg (codepug | last post by:
For lack of the proper expression, how do I excite a control to cause events to trigger. I have a date control and am using a calender form button to fill the text box with the date. The text box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.