0

I looked at the article at WPF add datagrid image column possible? and it looks fairly straightforward to add an image column to a datagrid. However one part I dont understand is the code line:

textColumn1.Binding = new Binding("YourBindingField");

Something similar appears in the MSDN help for Binding(string). What does this string mean and where is it coming from? what am I binding to . I am completely lost on this and need help as to where I get this string from. I just have an array of image paths. is there a class i need to build that links them somehow. Any help appreciated.

Community
  • 1
  • 1
rigamonk
  • 1,179
  • 2
  • 17
  • 45

2 Answers2

0

"YourBindingField" is the property that you are binding to the column. It is the property of your data context which can be either a dependency property in your code behind, or a property in the view model.

aggietech
  • 978
  • 3
  • 16
  • 38
0

This line is setting the Binding of the control to the Property "YourBindingField" on the current data context. WPF allows you to bind a controls value of an object that is set to the controls data context or the data context of one of its parent containers.

Dusty Lau
  • 591
  • 4
  • 18