-
Notifications
You must be signed in to change notification settings - Fork 0
ES-975464 - Resolve the ReadMe file length issue in this sample repository #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,99 @@ | ||
| # how-to-programmatically-expand-an-item-in-wpf-treeview-treeviewadv- | ||
| This sample shows how to programmatically expand an item in wpf treeview (treeviewadv). | ||
| # How to Programmatically Expand an Item in WPF TreeViewAdv? | ||
|
|
||
| This sample shows how to programmatically expand an item in [WPF TreeView](https://help.syncfusion.com/wpf/classic/treeview/overview) (TreeViewAdv). | ||
|
|
||
| `TreeViewAdv` allows to expand or collapse each node by setting [IsExpanded](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.TreeViewItemAdv.html#Syncfusion_Windows_Tools_Controls_TreeViewItemAdv_IsExpanded) property. | ||
|
|
||
| #### XAML | ||
|
|
||
| ``` csharp | ||
| <Grid x:Name="Grid"> | ||
| <syncfusion:TreeViewAdv Name="treeViewAdv"> | ||
| <syncfusion:TreeViewItemAdv Name="treeViewItemAdv" Header="Marital Status"> | ||
| <syncfusion:TreeViewItemAdv Header="Single"/> | ||
| <syncfusion:TreeViewItemAdv Header="Married"/> | ||
| <syncfusion:TreeViewItemAdv Header="Married with Children"/> | ||
| </syncfusion:TreeViewItemAdv> | ||
| <syncfusion:TreeViewItemAdv Header="Baby Vaccines"> | ||
| <syncfusion:TreeViewItemAdv Header="Hepatitis B"/> | ||
| <syncfusion:TreeViewItemAdv Header="Tetanus"/> | ||
| <syncfusion:TreeViewItemAdv Header="Polio"/> | ||
| <syncfusion:TreeViewItemAdv Header="Measles"/> | ||
| </syncfusion:TreeViewItemAdv> | ||
| <syncfusion:TreeViewItemAdv Header="Country Information"/> | ||
| </syncfusion:TreeViewAdv> | ||
| </Grid> | ||
| ``` | ||
|
|
||
| #### C# | ||
|
|
||
| ``` csharp | ||
| public MainWindow() | ||
| { | ||
| InitializeComponent(); | ||
SreemonPremkumarM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TreeViewAdv treeViewAdv = new TreeViewAdv(); | ||
| TreeViewItemAdv root1 = new TreeViewItemAdv() { Header = "Marital Status" }; | ||
| TreeViewItemAdv subitem11 = new TreeViewItemAdv() { Header = "Single" }; | ||
| TreeViewItemAdv subitem12 = new TreeViewItemAdv() { Header = "Married" }; | ||
| TreeViewItemAdv subitem13 = new TreeViewItemAdv() { Header = "Married with Children" }; | ||
|
|
||
| root1.Items.Add(subitem11); | ||
| root1.Items.Add(subitem12); | ||
| root1.Items.Add(subitem13); | ||
|
|
||
| TreeViewItemAdv root2 = new TreeViewItemAdv() { Header = "Baby Vaccines" }; | ||
| TreeViewItemAdv subitem21 = new TreeViewItemAdv() { Header = "Hepatitis B" }; | ||
| TreeViewItemAdv subitem22 = new TreeViewItemAdv() { Header = "Tetanus" }; | ||
| TreeViewItemAdv subitem23 = new TreeViewItemAdv() { Header = "Polio" }; | ||
| TreeViewItemAdv subitem24 = new TreeViewItemAdv() { Header = "Measles" }; | ||
|
|
||
| root2.Items.Add(subitem21); | ||
| root2.Items.Add(subitem22); | ||
| root2.Items.Add(subitem23); | ||
| root2.Items.Add(subitem24); | ||
|
|
||
| TreeViewItemAdv root3 = new TreeViewItemAdv() { Header = "Baby Vaccines" }; | ||
| treeViewAdv.Items.Add(root1); | ||
| treeViewAdv.Items.Add(root2); | ||
| treeViewAdv.Items.Add(root3); | ||
| Grid.Children.Add(treeViewAdv); | ||
| root1.IsExpanded = true; | ||
| } | ||
| ``` | ||
|
|
||
| #### VB | ||
|
|
||
SreemonPremkumarM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` vb | ||
| Public Sub New() | ||
| InitializeComponent() | ||
| Dim treeViewAdv As TreeViewAdv = New TreeViewAdv() | ||
| Dim root1 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Marital Status"} | ||
| Dim subitem11 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Single"} | ||
| Dim subitem12 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Married"} | ||
| Dim subitem13 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Married with Children"} | ||
|
|
||
| root1.Items.Add(subitem11) | ||
| root1.Items.Add(subitem12) | ||
| root1.Items.Add(subitem13) | ||
|
|
||
| Dim root2 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Baby Vaccines"} | ||
| Dim subitem21 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Hepatitis B"} | ||
| Dim subitem22 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Tetanus"} | ||
| Dim subitem23 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Polio"} | ||
| Dim subitem24 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Measles"} | ||
|
|
||
| root2.Items.Add(subitem21) | ||
| root2.Items.Add(subitem22) | ||
| root2.Items.Add(subitem23) | ||
| root2.Items.Add(subitem24) | ||
|
|
||
| Dim root3 As TreeViewItemAdv = New TreeViewItemAdv() With {.Header = "Baby Vaccines"} | ||
| treeViewAdv.Items.Add(root1) | ||
| treeViewAdv.Items.Add(root2) | ||
| treeViewAdv.Items.Add(root3) | ||
| Grid.Children.Add(treeViewAdv) | ||
| root1.IsExpanded = True | ||
| End Sub | ||
| ``` | ||
|
|
||
|  | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.