Databound values of an object for Textbox

Asked

Viewed 40 times

1

How can I databound an object to form fields?

The idea is to always fill in the "textBox1" field to update the "Name" value of the objClient automatically.

I know by direct assignment it works.

objCliente.Nome = textBox1.Text;

But by Databound is giving error:

textBox1.DataBindings.Add("Text", objCliente.Nome, "Text");
  • 3

    try textBox1.DataBindings.Add("Text", objCliente, "Nome");

  • 1

    This one using WPF?

  • I’m not in WPF.

  • What is the type of project then? Only C# is not enough to be sure of the answer

  • I am using wpf

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.