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.

2 Answers 2

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.

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.