I have a tree view with financial information. For a row that is not expanded, the cells show the totals of the hidden rows below. When expanding a row (showing the details), I want to clear the cells of the parent row so I just show the detail.
Below is the relevant code, it is firing for the secondary rows, but not for the expanded row.
Thanks,
Pat
Below is the relevant code, it is firing for the secondary rows, but not for the expanded row.
Thanks,
Pat
private void radTreeListView1_RowLoaded(object sender, RowLoadedEventArgs e)
{
var row = e.Row as TreeListViewRow;
if (row != null)
{
var binding = new Binding("IsRowExpanded") { Source = row.Item };
binding.Mode = BindingMode.TwoWay;
row.SetBinding(TreeListViewRow.IsExpandedProperty, binding);
}
}
}
public class HeaderRowSelector : DataTemplateSelector
{
public DataTemplate BlankCell { get; set; }
public DataTemplate NormalCell { get; set; }
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
FFSLStoreReportDataItem itm = item as FFSLStoreReportDataItem;
if(itm.IsRowExpanded)
return BlankCell;
else
return NormalCell;
}
}
}
namespace FFSLClient.FFSLServer
{
public partial class FFSLStoreReportDataItem
{
private bool _IsRowExpanded;
public bool IsRowExpanded
{
get
{
System.Diagnostics.Debug.WriteLine("Getting IsRowExpanded, Value:" + _IsRowExpanded.ToString());
return _IsRowExpanded;
}
set
{
System.Diagnostics.Debug.WriteLine("SETTING IsRowExpanded, Value:" + value.ToString());
_IsRowExpanded = value;
}
}
}