BeginEdit Method (Event?)


C

CJ Taylor

Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being fired or does
one exist?

Thanks,

-CJ
 
Ad

Advertisements

J

Jay B. Harlow [MVP - Outlook]

CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use DataTable.RowChanging &
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify when the
values are changing...

Hope this helps
Jay
 
C

CJ Taylor

Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit and add my
own event handlers... but that just seems like too much work... oh well, I
shall work with it.. Appreciate the help.

-CJ
 
J

Jay B. Harlow [MVP - Outlook]

CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier to find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay
 
C

CJ Taylor

Jay,

Yeah noticed all the things you were talking about. Which makes me wonder
how C1 did it in the first place.

Ahh, now the plot thickens as I reveal "why" I'm doing this. We were using
C1's DataObjects, unfortuantly C1 doesn't do very good debugging and its
suprisingly leaky (because some references are never destroyed, which should
be, but because their object model gets a little confusing I can't find the
source of all the errors).

However, C1 is inherited off the ADO.NET model, which is what led us to go
with it in the first place. And they have events that trigger off
BeginEdit... However, I don't think they directly inherit from DataRow, but
do use it as a storeage basin if you will...

On my beginedits I run some code to do some manipulation etc... mainly
decryption of certain fields, was just trying to replicate that
functionality. I figured out most of C1 without having to do much work. I
think its an incredibly over priced package for not much value. We'll just
have to see what ObjectSpaces brings to the table.

Thanks for your help, I have a workaround, I just didn't want to do it. =)

-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier to find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

CJ Taylor said:
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit and add my
own event handlers... but that just seems like too much work... oh
well,
I
shall work with it.. Appreciate the help.

-CJ


CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use DataTable.RowChanging &
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify
when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being fired or
does
one exist?

Thanks,

-CJ
 
W

William Ryan eMVP

CJ:

I don't think the DataRow has any events, and there are only like 6 for the
datatable ,RowChanging Rowchanged, ColumnChanging/Changed but nothign about
editing.

You may be better off trying to trap it in a control, but even there I
think most are going to be kinda limited
 
Ad

Advertisements

C

CJ Taylor

William,

Yeah I meant datatable, which actually fires a RowChanging event... my
fault, one of those "seeing" things ya know?

check out my other message, basically trying to replicate C1 without all the
B.S. involved...

I think I'm going to be one of the many to develop a new O/R mapper, just
need someone to build the Designer controls. =)

-CJ
 
J

Jay B. Harlow [MVP - Outlook]

CJ,
I have not actually used C1's DataObject, I looked at it briefly...

Looking at C1.Data.C1DataRow just now, they do not inherit from DataRow as
you indicate, however they implement the same interfaces!

You could create a similar proxy object by implementing the same interfaces,
I'm not sure if the DataTable itself will like you or not...

The interfaces you need are:

System.ComponentModel.ICustomTypeDescriptor
System.ComponentModel.IDataErrorInfo
System.ComponentModel.IEditableObject

The third being the interface where BeginEdit comes from.

Hope this helps
Jay


CJ Taylor said:
Jay,

Yeah noticed all the things you were talking about. Which makes me wonder
how C1 did it in the first place.

Ahh, now the plot thickens as I reveal "why" I'm doing this. We were using
C1's DataObjects, unfortuantly C1 doesn't do very good debugging and its
suprisingly leaky (because some references are never destroyed, which should
be, but because their object model gets a little confusing I can't find the
source of all the errors).

However, C1 is inherited off the ADO.NET model, which is what led us to go
with it in the first place. And they have events that trigger off
BeginEdit... However, I don't think they directly inherit from DataRow, but
do use it as a storeage basin if you will...

On my beginedits I run some code to do some manipulation etc... mainly
decryption of certain fields, was just trying to replicate that
functionality. I figured out most of C1 without having to do much work. I
think its an incredibly over priced package for not much value. We'll just
have to see what ObjectSpaces brings to the table.

Thanks for your help, I have a workaround, I just didn't want to do it. =)

-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier to find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

CJ Taylor said:
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit and
add
my
own event handlers... but that just seems like too much work... oh
well,
I
shall work with it.. Appreciate the help.

-CJ


CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use DataTable.RowChanging &
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being
fired
 
C

Cor Ligthert

Hi CJ,

Maybe a little bit late however I did some small tests

As far as i could see was only affected the rowchanged and rowchanging.
Columnschanging was not affected.

It is just a simple test.

\\\This was a part of the test it was done twice as you can understand and
you can assing it only if the row is added, however I think row added did
throw the event also the same as the delete.
Private Sub loadrows()
Dim dr As DataRow = dtName.NewRow
dtName.Rows.Add(dr)
If CJ Then
dr.BeginEdit()
End If
dr(0) = "mars"
dr(0) = "nuts"
dr(0) = "venus"
dr(1) = "helena"
dtName.Rows(0).Delete()
If CJ Then
dr.EndEdit()
End If
ds.AcceptChanges()
End Sub

I had at least only the rowchange event and with that I have put on the
console.

FalseRowChanged
FalseRowChanged
FalseRowChanged
FalseRowChanged
FalseRowChanged
TrueRowChanged
TrueRowChanged

I hope this helps a very little bit.

Cor
 
C

CJ Taylor

Jay,

Yeah, it implements the same interfaces, but you have to look at the
StoreageDataRow or StoreageDataTable or StorageDataset properties of their
respective C1 counterparts. These are all ADO.NET objects (DataRow,
DataTable,DataSet) which actually stores the value...

Then implement the same interfaces in order to make it work with standard
databinding within winforms... nice feature... but the focus was misplaced
in creating DataObjects I think...

I'm most dissapointed with the support though... this is the problem with
outsourcing software.. Sure, it's done, it's *pretty* good... but after
awhile the software house stops giving support, which is really annoying.





Jay B. Harlow said:
CJ,
I have not actually used C1's DataObject, I looked at it briefly...

Looking at C1.Data.C1DataRow just now, they do not inherit from DataRow as
you indicate, however they implement the same interfaces!

You could create a similar proxy object by implementing the same interfaces,
I'm not sure if the DataTable itself will like you or not...

The interfaces you need are:

System.ComponentModel.ICustomTypeDescriptor
System.ComponentModel.IDataErrorInfo
System.ComponentModel.IEditableObject

The third being the interface where BeginEdit comes from.

Hope this helps
Jay


CJ Taylor said:
Jay,

Yeah noticed all the things you were talking about. Which makes me wonder
how C1 did it in the first place.

Ahh, now the plot thickens as I reveal "why" I'm doing this. We were using
C1's DataObjects, unfortuantly C1 doesn't do very good debugging and its
suprisingly leaky (because some references are never destroyed, which should
be, but because their object model gets a little confusing I can't find the
source of all the errors).

However, C1 is inherited off the ADO.NET model, which is what led us to go
with it in the first place. And they have events that trigger off
BeginEdit... However, I don't think they directly inherit from DataRow, but
do use it as a storeage basin if you will...

On my beginedits I run some code to do some manipulation etc... mainly
decryption of certain fields, was just trying to replicate that
functionality. I figured out most of C1 without having to do much work. I
think its an incredibly over priced package for not much value. We'll just
have to see what ObjectSpaces brings to the table.

Thanks for your help, I have a workaround, I just didn't want to do it. =)

-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier
to
find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit and add
my
own event handlers... but that just seems like too much work... oh well,
I
shall work with it.. Appreciate the help.

-CJ


CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use DataTable.RowChanging &
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being
fired
or
does
one exist?

Thanks,

-CJ
 
C

CJ Taylor

I appreciate it Cor, I saw the RowChanging works fine, but column I can't
get it to work either...

Not quite what I was looking for, but it will be fine... After seeing how C1
did it, in their own Geriatric way I just have to find a better way.

appreciated.
,
cj
 
Ad

Advertisements

J

Jay B. Harlow [MVP - Outlook]

CJ,
Like I said I have not really used C1's Data Objects, seeing as they appear
to be wrappers around ADO.NET, their purpose in life eludes me.

Maybe if I spent more time with them...

Jay

CJ Taylor said:
Jay,

Yeah, it implements the same interfaces, but you have to look at the
StoreageDataRow or StoreageDataTable or StorageDataset properties of their
respective C1 counterparts. These are all ADO.NET objects (DataRow,
DataTable,DataSet) which actually stores the value...

Then implement the same interfaces in order to make it work with standard
databinding within winforms... nice feature... but the focus was misplaced
in creating DataObjects I think...

I'm most dissapointed with the support though... this is the problem with
outsourcing software.. Sure, it's done, it's *pretty* good... but after
awhile the software house stops giving support, which is really annoying.





Jay B. Harlow said:
CJ,
I have not actually used C1's DataObject, I looked at it briefly...

Looking at C1.Data.C1DataRow just now, they do not inherit from DataRow as
you indicate, however they implement the same interfaces!

You could create a similar proxy object by implementing the same interfaces,
I'm not sure if the DataTable itself will like you or not...

The interfaces you need are:

System.ComponentModel.ICustomTypeDescriptor
System.ComponentModel.IDataErrorInfo
System.ComponentModel.IEditableObject

The third being the interface where BeginEdit comes from.

Hope this helps
Jay


find
the
to
go DataRow,
but work.
I
it.
=)
-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier to
find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit
and
add
my
own event handlers... but that just seems like too much work... oh
well,
I
shall work with it.. Appreciate the help.

-CJ


message
CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use
DataTable.RowChanging
&
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify
when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being fired
or
does
one exist?

Thanks,

-CJ
 
C

CJ Taylor

Don't waste your time...

=)

Jay B. Harlow said:
CJ,
Like I said I have not really used C1's Data Objects, seeing as they appear
to be wrappers around ADO.NET, their purpose in life eludes me.

Maybe if I spent more time with them...

Jay

CJ Taylor said:
Jay,

Yeah, it implements the same interfaces, but you have to look at the
StoreageDataRow or StoreageDataTable or StorageDataset properties of their
respective C1 counterparts. These are all ADO.NET objects (DataRow,
DataTable,DataSet) which actually stores the value...

Then implement the same interfaces in order to make it work with standard
databinding within winforms... nice feature... but the focus was misplaced
in creating DataObjects I think...

I'm most dissapointed with the support though... this is the problem with
outsourcing software.. Sure, it's done, it's *pretty* good... but after
awhile the software house stops giving support, which is really annoying.
DataRow
as
you indicate, however they implement the same interfaces!

You could create a similar proxy object by implementing the same interfaces,
I'm not sure if the DataTable itself will like you or not...

The interfaces you need are:

System.ComponentModel.ICustomTypeDescriptor
System.ComponentModel.IDataErrorInfo
System.ComponentModel.IEditableObject

The third being the interface where BeginEdit comes from.

Hope this helps
Jay


"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Jay,

Yeah noticed all the things you were talking about. Which makes me wonder
how C1 did it in the first place.

Ahh, now the plot thickens as I reveal "why" I'm doing this. We were
using
C1's DataObjects, unfortuantly C1 doesn't do very good debugging and its
suprisingly leaky (because some references are never destroyed, which
should
be, but because their object model gets a little confusing I can't find
the
source of all the errors).

However, C1 is inherited off the ADO.NET model, which is what led us
to
go
with it in the first place. And they have events that trigger off
BeginEdit... However, I don't think they directly inherit from DataRow,
but
do use it as a storeage basin if you will...

On my beginedits I run some code to do some manipulation etc... mainly
decryption of certain fields, was just trying to replicate that
functionality. I figured out most of C1 without having to do much work.
I
think its an incredibly over priced package for not much value. We'll
just
have to see what ObjectSpaces brings to the table.

Thanks for your help, I have a workaround, I just didn't want to do
it.
=)

-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its
easier
to
find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose
that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend
events
from
firing... owever, I suppose I could get it from the col changed event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin edit and
add
my
own event handlers... but that just seems like too much work... oh
well,
I
shall work with it.. Appreciate the help.

-CJ


message
CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use
DataTable.RowChanging
&
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify
when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being
fired
or
does
one exist?

Thanks,

-CJ
 
Ad

Advertisements

J

Jay B. Harlow [MVP - Outlook]

CJ,
Its not on my list ;-)

I see more value (and its higher on my list) to look at Rockford Lhotka's
CSLA.NET http://www.lhotka.net/.

Although I've already implemented most of the "data binding" interfaces
(that CSLA.NET & DataSets also implements) in my own Domain classes on one
of my projects...

Jay


CJ Taylor said:
Don't waste your time...

=)

Jay B. Harlow said:
CJ,
Like I said I have not really used C1's Data Objects, seeing as they appear
to be wrappers around ADO.NET, their purpose in life eludes me.

Maybe if I spent more time with them...

Jay

CJ Taylor said:
Jay,

Yeah, it implements the same interfaces, but you have to look at the
StoreageDataRow or StoreageDataTable or StorageDataset properties of their
respective C1 counterparts. These are all ADO.NET objects (DataRow,
DataTable,DataSet) which actually stores the value...

Then implement the same interfaces in order to make it work with standard
databinding within winforms... nice feature... but the focus was misplaced
in creating DataObjects I think...

I'm most dissapointed with the support though... this is the problem with
outsourcing software.. Sure, it's done, it's *pretty* good... but after
awhile the software house stops giving support, which is really annoying.





CJ,
I have not actually used C1's DataObject, I looked at it briefly...

Looking at C1.Data.C1DataRow just now, they do not inherit from
DataRow
as
you indicate, however they implement the same interfaces!

You could create a similar proxy object by implementing the same
interfaces,
I'm not sure if the DataTable itself will like you or not...

The interfaces you need are:

System.ComponentModel.ICustomTypeDescriptor
System.ComponentModel.IDataErrorInfo
System.ComponentModel.IEditableObject

The third being the interface where BeginEdit comes from.

Hope this helps
Jay


"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Jay,

Yeah noticed all the things you were talking about. Which makes me
wonder
how C1 did it in the first place.

Ahh, now the plot thickens as I reveal "why" I'm doing this. We were
using
C1's DataObjects, unfortuantly C1 doesn't do very good debugging
and
its
suprisingly leaky (because some references are never destroyed, which
should
be, but because their object model gets a little confusing I can't find
the
source of all the errors).

However, C1 is inherited off the ADO.NET model, which is what led
us
to
go
with it in the first place. And they have events that trigger off
BeginEdit... However, I don't think they directly inherit from DataRow,
but
do use it as a storeage basin if you will...

On my beginedits I run some code to do some manipulation etc... mainly
decryption of certain fields, was just trying to replicate that
functionality. I figured out most of C1 without having to do much work.
I
think its an incredibly over priced package for not much value. We'll
just
have to see what ObjectSpaces brings to the table.

Thanks for your help, I have a workaround, I just didn't want to
do
it.
=)

-CJ



CJ,
Doh! you are right... DataRow.BeginEdit suspends events...

I was thinking only DataTable.BeginLoadData suspended events.

I'm not sure if Sceppa talks about it or not, I just find its easier
to
find
details about ADO.NET in Sceppa's book over MSDN itself...

Unfortunately DataRow.BeginEdit is not overridable either, so you
cannot
derive from DataRow and add the functionality...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Heh... my Sceppa book is sitting right next to me...

didn't find anything in there but I will look further.. I suppose
that
would be a way to do it...

However, when you call BeginEdit it is supposed to suspend events
from
firing... owever, I suppose I could get it from the col changed
event
without a begin edit...

hmm...

that kinda sucks...

I could always catch the first colchanged event, call begin
edit
and
add
my
own event handlers... but that just seems like too much
work...
oh
well,
I
shall work with it.. Appreciate the help.

-CJ


message
CJ,
My Sceppa ADO.NET book is at the office.

I believe the closest you will get is to use DataTable.RowChanging
&
DataTable.ColumnChanging.

Which doesn't identify the BeginEdit itself, however they identify
when
the
values are changing...

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
Alright on a DataRow you have the BeginEdit method

Where can I catch an event that tells me that method is being
fired
or
does
one exist?

Thanks,

-CJ
 

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