L
LB
Reading the http://samples.gotdotnet.com/quickstart/winforms/
I'm trying to see the advantage of using "simple data binding".
Let's say I have a treeview loaded from a collection called moList.
On form load, the treeview is loaded. And I bind my textbox to one on the
property
txtLength.DataBindings.Add("Text", moList, "Length")
On the TreeView1 click event, I add the following line :
Me.BindingContext(moList).Position = TreeView1.SelectedNode.Index
Everything is displayed on the form.
But why should I use the DataBindings.Add and BindingContext ?
Couldn't I use directly on the click event directly the following :
txtLength.text = moList.Item(TreeView1.SelectedNode.Index).Length
What's the advantage ?
Thank you for your time
I'm trying to see the advantage of using "simple data binding".
Let's say I have a treeview loaded from a collection called moList.
On form load, the treeview is loaded. And I bind my textbox to one on the
property
txtLength.DataBindings.Add("Text", moList, "Length")
On the TreeView1 click event, I add the following line :
Me.BindingContext(moList).Position = TreeView1.SelectedNode.Index
Everything is displayed on the form.
But why should I use the DataBindings.Add and BindingContext ?
Couldn't I use directly on the click event directly the following :
txtLength.text = moList.Item(TreeView1.SelectedNode.Index).Length
What's the advantage ?
Thank you for your time