binding

  • Thread starter Thread starter crain
  • Start date Start date
C

crain

hi i am just trying to learn all aspects of binding

my sample code

DataSet ds = new DataSet();
DataTable cust = new DataTable ("Cust");
DataColumn custid = new DataColumn ("custid",typeof(int));
DataColumn custname = new DataColumn ("custname",typeof(string));
ds.Tables.Add(cust);
cust.Columns.Add(custid);
cust.Columns.Add(custname);
DataRow dr ;
dr= cust.NewRow();
dr["custid"]=1;
dr["custname"]="sheraze";
cust.Rows.Add(dr);
dr = null;
dr= cust.NewRow();
dr["custid"]=2;
dr["custname"]="juzan";
cust.Rows.Add(dr);

tx.DataBindings.Add( new Binding ("Text",ds,"cust.custid"));
textBox2.DataBindings.Add(new Binding ("Text",ds,"cust.custname"));
bmCustomers = this.BindingContext [ds, "cust"];




now,
bmCustomers.ToString() gives
"System.Windows.Forms.RelatedCurrencyManager"

in what senarios can i use currencymanager and propertymanager?

thanx
 
hi cor
i have read this .

in fact my sample is copied from msdn.

"The PropertyManager inherits from the BindingManagerBase, and it is used to
maintain the current property of an object, rather than the property of a
current object in a list. For this reason, trying to set the Position or
Count property for a PropertyManager has no effect. Similarly, the AddNew
and RemoveAt methods are not supported because there is no underlying list
of data to add to or delete from."

i dont quite understand what this means.
but however an example would make things clear.
i read the example on msdn but it doesnt talk specifically about
propertymanager or currencymanager.
id like to know when to use each .
thanx
 
Hi Crain,

You asking this to probably one of the most pragmatics active in this dotnet
newsgroups.

However and although I never have used the property manager.

When I read it, than in my pragmatic way I read that the propertymanager
manages an item in a "list" that is managed by the bindingManager class.

Cor
 
Back
Top