Skip to content

Commit 519781c

Browse files
authored
Merge pull request #3 from SyncfusionExamples/ES-975464
ES-975464 - Resolve the ReadMe issue in this sample repository
2 parents 26f50ef + cdd2795 commit 519781c

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

README.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,54 @@
1-
# How to get the node in WPF TreeView (SfTreeView)?
1+
# How to Get the Node in WPF TreeView?
22

3-
How to get the node in WPF TreeView (SfTreeView)?
3+
This sample illustrates how to get the node in [WPF TreeView](https://www.syncfusion.com/wpf-controls/treeview) (SfTreeView).
44

55
# About the sample
66

7-
In SfTreeView, you can get the node based on the item bound with it using SfTreeView.GetItemInfo method.
7+
In `SfTreeView`, you can get the node based on the item bound with it using `SfTreeView.GetItemInfo` method.
8+
9+
#### XAML
10+
11+
``` xml
12+
<syncfusion:SfTreeView x:Name="sfTreeView" Grid.Row="1" ExpandActionTrigger="Node" AutoExpandMode="AllNodes"
13+
ChildPropertyName="SubFiles"
14+
FullRowSelect="True"
15+
ItemsSource="{Binding ImageNodeInfo}">
16+
<syncfusion:SfTreeView.ItemTemplate>
17+
<DataTemplate>
18+
<Grid x:Name="grid">
19+
<Grid Grid.Row="0">
20+
<Grid.ColumnDefinitions>
21+
<ColumnDefinition Width="20" />
22+
<ColumnDefinition Width="*" />
23+
</Grid.ColumnDefinitions>
24+
<Grid>
25+
<Image Source="{Binding ImageIcon}"
26+
VerticalAlignment="Center"
27+
HorizontalAlignment="Center"
28+
Height="16"
29+
Width="16"/>
30+
</Grid>
31+
<Grid Grid.Column="1"
32+
Margin="1,0,0,0"
33+
VerticalAlignment="Center">
34+
<TextBlock Text="{Binding ItemName}"
35+
Foreground="Black"
36+
FontSize="13"
37+
VerticalAlignment="Center" />
38+
</Grid>
39+
</Grid>
40+
</Grid>
41+
</DataTemplate>
42+
</syncfusion:SfTreeView.ItemTemplate>
43+
</syncfusion:SfTreeView>
44+
```
45+
46+
#### C#
847

948
```c#
1049
var treeViewInfo = sfTreeView.GetItemInfo((this.DataContext as FileManagerViewModel).ImageNodeInfo.FirstOrDefault(x => x.ItemName == "Documents"));
1150
var node = treeViewInfo.Node;
1251
```
1352

14-
KB article - [How to get the node in WPF TreeView (SfTreeView)?](https://www.syncfusion.com/kb/11991/how-to-get-the-node-in-wpf-treeview-sftreeview)
15-
1653
## Requirements to run the demo
1754
Visual Studio 2015 and above versions

0 commit comments

Comments
 (0)