[2008] How do I find the datamember?
Hi,
I'm using the following to bind to a TextBox:
Code:
Me.txtDescription.DataBindings.Add(New Binding("Text", myBind, "description"))
However, at run time, I need to be able to determine what the dataMember is for txtDescription elsewhere in the code. How do I get at it?
Re: [2008] How do I find the datamember?
That code adds a new Binding object to the TextBox's DataBindings collection. You can get that Binding back from that collection by indexing it by property name, i.e.
vb.net Code:
Dim textBinding As Binding = Me.txtDescription.DataBindings("Text")
You can then get all the information you need from the properties of that object.