WPF Binding to DataRow Columns
Posted
by Trindaz
on Stack Overflow
See other posts from Stack Overflow
or by Trindaz
Published on 2010-04-15T01:44:57Z
Indexed on
2010/04/15
2:13 UTC
Read the original article
Hit count: 1018
Hi,
I've taken some sample code from http://sweux.com/blogs/smoura/index.php/wpf/2009/06/15/wpf-toolkit-datagrid-part-iv-templatecolumns-and-row-grouping/ that provides grouping of data in a WPF DataGrid. I'm modifying the example to use a DataTable instead of a Collection of entities.
My problem is in translating a binding declaration {Binding Parent.IsExpanded}, which works fine where Parent is a reference to an entity that has the IsExpanded attribute, to something that will work for my weakly typed DataTable, where Parent is the name of a column and references another DataRow in the same DataTable. I've tried declarations like {Binding Parent.Items[IsExpanded]} and {Binding Parent("IsExpanded")} but none of these seem to work.
How can I create a binding to the IsExpanded column of the DataRow Parent in my DataTable?
Thanks in advance, Dave
© Stack Overflow or respective owner