private void SetBinding() { this.Databinding.Add( this.BindProperty, this.BindTable, this.BindTo ); } //DataBinding class public void Add(string bindProperty, string bindTable, string bindTo) { this._bindProperty = bindProperty; this._bindTable = bindTable; this._bindTo = bindTo; }PS: Not talking about built-in DataBinding class just outlining code - check that one too.
>//Lets say we are in a textBox >this.BindTo = "Name"; // the field name to bind to >this.BindTable = "Table1"; // the table to bind to >this.BindProperty = "Text"; // The property of this control to bind >this.SetBinding() > >private void SetBinding() >{ > this.Databinding.Add( this.BindProperty, this.BindTable, this.BindTo ); >} >>
>>>class TestClass >>>{ >>> private string _myString = "hello"; >>> >>> public TestClass() >>> { >>> this.ChangeString( "_myString", "SomeNewValue" ); >>> } >>> public void ChangeString( string fldname, string newValue ) >>> { >>> // refer to the field fldname and change it's value to newValue >>> ?????? >>> } >>>} >>>>>>