> Everything seems fine when I run my application except... The statement
> that assigns the DataSource causes BeginEdit() to be called on my object in
> my custom list and it does not call EndEdit(). This prevents me from being
> able to actually edit any data in the grid because the first call to edit
> never finishes.
From msdn:
Implementations of the IEditableObject interface should keep track of
whether the BeginEdit has already been called and ignore subsequent calls to
BeginEdit.
Ernest
> Hello, can someone help me?
>
[quoted text clipped - 10 lines]
>
> xrite.retail.dll!XRite.Retail.PaletteInfo.BeginEdit() Line 193 C#
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.OnCurrentChang
> ed(System.EventArgs e = {System.EventArgs}) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.ChangeRecordSt
> ate(int newPosition = 0, bool validating = true, bool endCurrentEdit =
> false, bool firePositionChange = true, bool pullData = false) + 0x157 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.UpdateIsBindin
> g(bool force = false) + 0xd0 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.UpdateIsBindin
> g() + 0xd bytes
system.windows.forms.dll!System.Windows.Forms.BindingManagerBase.PushData()
> + 0x1d bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.CurrencyManage
> r_PushData() + 0x47 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.OnItemChanged(
> System.Windows.Forms.ItemChangedEventArgs e = {Index=-1}) + 0x78 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.SetDataSource(
> System.Object dataSource = {XRite.Retail.Collections.PaletteInfoArrayList})
> + 0x14b bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.CurrencyManage
> r(System.Object dataSource =
> {XRite.Retail.Collections.PaletteInfoArrayList}) + 0x5d bytes
system.windows.forms.dll!System.Windows.Forms.BindingContext.EnsureListManag
> er(System.Object dataSource =
> {XRite.Retail.Collections.PaletteInfoArrayList}, string dataMember = "") +
> 0x11a bytes
system.windows.forms.dll!System.Windows.Forms.BindingContext.get_Item(System
> .Object dataSource = {XRite.Retail.Collections.PaletteInfoArrayList}, string
> dataMember = "") + 0x15 bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.Set_ListManager(Syste
> m.Object newDataSource = {XRite.Retail.Collections.PaletteInfoArrayList},
> string newDataMember = "", bool force = false, bool forceColumnCreation =
> true) + 0x157 bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.Set_ListManager(Syste
> m.Object newDataSource = {XRite.Retail.Collections.PaletteInfoArrayList},
> string newDataMember = "", bool force = false) + 0x1c bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.set_DataSource(System
> .Object value = {XRite.Retail.Collections.PaletteInfoArrayList}) + 0x190
> bytes
[quoted text clipped - 4 lines]
>
> -dh
David Hoffer - 08 Jul 2004 15:17 GMT
I think I am doing this already. Here is what I am doing...
public void BeginEdit()
{
if (!m_bInTxn)
{
// Save backup copy of data...
m_bInTxn = true;
}
}
public void CancelEdit()
{
if (m_bInTxn)
{
// Undo backup copy of data...
m_bInTxn = false;
}
}
public void EndEdit()
{
if (m_bInTxn)
{
m_bInTxn = false;
}
OnChanged();
}
> > Everything seems fine when I run my application except... The statement
> > that assigns the DataSource causes BeginEdit() to be called on my object
[quoted text clipped - 31 lines]
> system.windows.forms.dll!System.Windows.Forms.CurrencyManager.OnCurrentChang
> > ed(System.EventArgs e = {System.EventArgs}) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.ChangeRecordSt
> > ate(int newPosition = 0, bool validating = true, bool endCurrentEdit =
> > false, bool firePositionChange = true, bool pullData = false) + 0x157
> bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.UpdateIsBindin
> > g(bool force = false) + 0xd0 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.UpdateIsBindin
> > g() + 0xd bytes
system.windows.forms.dll!System.Windows.Forms.BindingManagerBase.PushData()
> > + 0x1d bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.CurrencyManage
> > r_PushData() + 0x47 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.OnItemChanged(
> > System.Windows.Forms.ItemChangedEventArgs e = {Index=-1}) + 0x78 bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.SetDataSource(
> > System.Object dataSource =
> {XRite.Retail.Collections.PaletteInfoArrayList})
> > + 0x14b bytes
system.windows.forms.dll!System.Windows.Forms.CurrencyManager.CurrencyManage
> > r(System.Object dataSource =
> > {XRite.Retail.Collections.PaletteInfoArrayList}) + 0x5d bytes
system.windows.forms.dll!System.Windows.Forms.BindingContext.EnsureListManag
> > er(System.Object dataSource =
> > {XRite.Retail.Collections.PaletteInfoArrayList}, string dataMember = "") +
> > 0x11a bytes
system.windows.forms.dll!System.Windows.Forms.BindingContext.get_Item(System
> > .Object dataSource = {XRite.Retail.Collections.PaletteInfoArrayList},
> string
> > dataMember = "") + 0x15 bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.Set_ListManager(Syste
> > m.Object newDataSource = {XRite.Retail.Collections.PaletteInfoArrayList},
> > string newDataMember = "", bool force = false, bool forceColumnCreation =
> > true) + 0x157 bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.Set_ListManager(Syste
> > m.Object newDataSource = {XRite.Retail.Collections.PaletteInfoArrayList},
> > string newDataMember = "", bool force = false) + 0x1c bytes
system.windows.forms.dll!System.Windows.Forms.DataGrid.set_DataSource(System
> > .Object value = {XRite.Retail.Collections.PaletteInfoArrayList}) + 0x190
> > bytes
[quoted text clipped - 5 lines]
> >
> > -dh