Hello,
I was wondering how do I go about retrieving the name of XamTreeItem that you click on.
For example if this was my tree in xaml.
<ig:XamTreeItem Name="Person" Header="Person"> <ig:XamTreeItem Name="cboCreator" Header="Creator" /> <ig:XamTreeItem Name="cboReference" Header="Reference"/> <ig:XamTreeItem Name="cboContributor" Header="Contributor"/> <ig:XamTreeItem Name="dgDonor" Header="Donor"/>
</ig:XamTreeItem>
Say the user clicks on XamTreeItem "cboCreator". In my C# code, how I do retrieve the selected item name?
Thanks for the reply,
Kiet
Thanks Hady!
put them in a XamTree
<ig:XamTree Height="100" HorizontalAlignment="Left" Margin="142,146,0,0" Name="xamTree1" VerticalAlignment="Top" Width="200" SelectionChanged="xamTree1_SelectionChanged">
<ig:XamTreeItem Name="Person" Header="Person">
<ig:XamTreeItem Name="cboCreator" Header="Creator" />
<ig:XamTreeItem Name="cboReference" Header="Reference"/>
<ig:XamTreeItem Name="cboContributor" Header="Contributor"/>
<ig:XamTreeItem Name="dgDonor" Header="Donor"/>
</ig:XamTree>
and use the event:
private void xamTree1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string s;
if (e.AddedItems.Count > 0)
s = ((Infragistics.Controls.Menus.XamTreeItem)e.AddedItems[0]).Name;
}