Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight 4 : TreeView/ HierarchicalDataTemplate/ AutoExpand Issue
    primarykey
    data
    text
    <p>I have a treeview control in my silverlight application which uses 2 HierarchicalDataTemplate(s) to show data in a rquired format. I would like to have this tree autoexpanded when open for first time (preferably, a code snippet which i may call any time i want).</p> <p>Any alternatives to the given code would also be welcome.</p> <pre><code>&lt;sdk:TreeView x:Name="tvPageManager" Style="{StaticResource PageManagerStyle}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto"&gt; &lt;sdk:TreeView.ItemTemplate&gt; &lt;sdk:HierarchicalDataTemplate ItemsSource="{Binding KeyPoints, Mode=TwoWay}"&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;ToolTipService.ToolTip&gt; &lt;ToolTip Content="{Binding PageName}" Style="{StaticResource ToolTipStyle}"/&gt; &lt;/ToolTipService.ToolTip&gt; &lt;Image x:Name="imgPageIcon" Source="{Binding PageIconImage}" Style="{StaticResource PageIconStyle}" Tag="{Binding BurstPageId, Mode=TwoWay}" /&gt; &lt;TextBlock x:Name="tbkLiteralTextPage" Text="Page " Style="{StaticResource PageNameLiteralTextBlockStyle}" /&gt; &lt;TextBox x:Name="tbPageName" Text="{Binding PageName, Mode=TwoWay}" Style="{StaticResource PageNameTextBoxStyle}" /&gt; &lt;/StackPanel&gt; &lt;sdk:HierarchicalDataTemplate.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;Image x:Name="imgKeypointIcon" Source="../Assets/Images/bullet_yellow.png" Style="{StaticResource KeypointIconStyle}"/&gt; &lt;TextBlock x:Name="tbkKeypointTitle" Text="{Binding Title, Mode=TwoWay}" Style="{StaticResource KeypointNameTextBlockStyle}" /&gt; &lt;StackPanel x:Name="spnlMoveImages" Orientation="Horizontal" HorizontalAlignment="Right" Width="30"&gt; &lt;Image x:Name="imgMoveUp" Source="../Assets/Images/up_arrow.png" Style="{StaticResource MoveIconsStyle}" Tag="{Binding KeyPointId}"/&gt; &lt;Image x:Name="imgMoveDn" Source="../Assets/Images/down_arrow.png" Style="{StaticResource MoveIconsStyle}" Tag="{Binding KeyPointId}"/&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/sdk:HierarchicalDataTemplate.ItemTemplate&gt; &lt;/sdk:HierarchicalDataTemplate&gt; &lt;/sdk:TreeView.ItemTemplate&gt; &lt;/sdk:TreeView&gt; </code></pre> <p>This control is bound to a Observable list of BurstPage class. The complete data structure is as;</p> <p>The parent element is Burst object which contains 1 to n BurstPage objects, Any given BurstPage may have 1 to n Keypoint objects in it.</p> <p>BurstPage.Name (say 1) Keypoint.Name (say A) Keypoint.Name (say B) Keypoint.Name (say C) BurstPage.Name (say 2) BurstPage.Name (say 3) Keypoint.Name (say D) Keypoint.Name (say E)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload