0
我想在treeviewiňWPF.I添加項目具有功能TreeView的數據綁定
public void SetTree(string Title,int Boxtype,int BoxNo)
{
sBoxType = "Group";
TreeList items = TreeList.Load(Title, sBoxType, BoxNo);
DataContext = items;
}
XAML TreeView控件的代碼:
<TreeView Margin="16,275,18,312" x:Name="treeView1" ItemsSource="{Binding}" ItemTemplate="{StaticResource TreeItemTemplate}">
</TreeView>
<DataTemplate x:Key="TreeItemTemplate">
<WrapPanel>
<TextBlock Text="{Binding Path=Title}" />
<TextBlock Text="{Binding Path=Box}" />
</WrapPanel>
</DataTemplate>
其實我婉的TreeView OT顯示LIK
+Group (header)
Controllersgroup 5 (Child items).
作爲多欄子項目。但它像
Controllersgroup5