Deleting a record

I found a pretty good tutorial on bindingcontext at

http://www.alanddave.com/daveroom/presentations/default.asp

I've been able to add a record using bindingcontext.AddNew() , but deleting escapes me.
The sample code is in vb and I cant change the first line to C#

Dim cmgr AS CurrencyManager = me.BindingContext[me.dsClients, "Client"]

cmgr.RemoveAt(cmgr.Position)

CurrencyManager cmgr = this.Binding....
gives an "implicitly converting BindingMgrBase to CurrencyMgr" message, and I can't find a function to do it explicitly.

what am I missing here?

Bob Hagan

[606 byte] By [codefund.com] at [2007-12-16]
# 1
CurrencyManager inherits from BindingManagerBase, so you should be able to cast it directly, like this:

CurrencyManager cmgr = (CurrencyManager)this.BindingContext[this.dsClients, "Client"];

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
That works.

Thanks

bob hagan

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...