views:

201

answers:

1

Hi All,

I want to bind TextBox's Text property to FolderBrowser's SelectedPath property. But it's not working, I don't know why. Please help me out why it's not working?

+2  A: 

Data binding makes very little sense here. Just make your code look like this:

  if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) {
    // User picked a path and didn't cancel the dialog...
    textBox1.Text = folderBrowserDialog1.SelectedPath;
  }
Hans Passant
yes sure but I want to know why it doesn't work with data binding?
Praveen Sharma
I don't know, you haven't said squat about how you tried to bind it.
Hans Passant