我尝试循环到我的3级Treeview的每个节点,但ItemContainerGenerator.ContainerFromItem返回空值
chart.series[0].setData(marker_points,true);
TVI2为空
这是xaml
foreach (DataRowView obje in tvMain.Items)
{
TreeViewItem TVI = (TreeViewItem)tvMain.ItemContainerGenerator.ContainerFromItem(obje);
foreach (DataRowView obje2 in TVI.Items)
{
TreeViewItem TVI2 = (TreeViewItem)TVI.ItemContainerGenerator.ContainerFromItem(obje2);
}
}
非常感谢