Get the bound field of a control

  • Thread starter Thread starter BD
  • Start date Start date
B

BD

Hi,

How can I get the name of the bound field from a control that has
binding to a BindingSource at runtime. For example:

txtID.DataBindings.Add("Text", bdgSourceTest, "ID");

txtID is a TextBox and I want to get the bound field "ID" from txtID.

[]'s
BD
 
Hi,

How can I get the name of the bound field from a control that has
binding to a BindingSource at runtime. For example:

txtID.DataBindings.Add("Text", bdgSourceTest, "ID");

txtID is a TextBox and I want to get the bound field "ID" from txtID.

[]'s
BD

txtID.DataBindings[0].PropertyName;

Or what ever the ordinal of the Databinding is. It's probably worth
checking
txtID.DataBindings.Count before bundling in :)
 
Hi,

How can I get the name of the bound field from a control that has
binding to a BindingSource at runtime. For example:

txtID.DataBindings.Add("Text", bdgSourceTest, "ID");

txtID is a TextBox and I want to get the bound field "ID" from txtID.

[]'s
BD

txtID.DataBindings[0].PropertyName;

Or what ever the ordinal of the Databinding is. It's probably worth
checking
txtID.DataBindings.Count before bundling in :)


Problem solved thanks. Yes I will check for the Count before :)

[]'s
BD
 
Back
Top