or
<Border Background="{DynamicResource GridView_HeaderBackground}" BorderThickness="1" BorderBrush="{DynamicResource GridView_GridLinesItemBorder}">001.private object actualScrollToItem = null;002.private object currentScrollToItem = null;003.private List<object> scrollItems = null;004.private int scrollToItemAttemptCount = 0;005. 006.private void SelectedItemTargetUpdated(object sender, DataTransferEventArgs e)007.{008. var item = GetValue(e.Property);009. 010. /* SNIP IRRELEVANT CODE TO SCROLLING */011. 012. actualScrollToItem = item;013. 014. if (actualScrollToItem is IScrollableGridItem)015. {016. Console.WriteLine("-- BEGIN SCROLLING TO {0} --", actualScrollToItem.GetHashCode());017. 018. var tmp = item as IScrollableGridItem;019. 020. // Get a list of items to scroll to021. scrollItems = tmp.GetScrollList();022. 023. // Start scrolling to the first item024. currentScrollToItem = scrollItems.First();025. 026. GridControl.ScrollIntoViewAsync(currentScrollToItem, Scroll, ScrollFailed);027. 028. }029. else030. {031. // Attempt is not IScrollable, attempt to scroll anyway032. currentScrollToItem = actualScrollToItem;033. Console.WriteLine("Item is not IScrollable");034. GridControl.ScrollIntoViewAsync(actualScrollToItem, Scroll, ScrollFailed);035. }036.}037. 038.private void Scroll(FrameworkElement arg)039.{040. Console.WriteLine("Succesfully scrolled to {0}", currentScrollToItem.GetHashCode());041. 042. scrollToItemAttemptCount = 0;043. 044. var row = arg as GridViewRow;045. 046. if (actualScrollToItem == currentScrollToItem)047. {048. Console.WriteLine("Reached actual scroll item");049. Console.WriteLine("-- END SCROLLING TO {0} --", actualScrollToItem.GetHashCode());050. GridControl.ClearSelection();051. GridControl.SelectedItems.Add(currentScrollToItem);052. 053. actualScrollToItem = null;054. currentScrollToItem = null;055. scrollItems = null;056. 057. if (row != null)058. {059. row.IsCurrent = true;060. row.Focus();061. row.BringIntoView();062. }063. }064. else065. {066. if (row != null && row.IsExpandable)067. {068. row.IsExpanded = true;069. }070. 071. var idx = scrollItems.IndexOf(currentScrollToItem);072. currentScrollToItem = scrollItems[idx + 1];073. 074. GridControl.ScrollIntoViewAsync(currentScrollToItem, Scroll, ScrollFailed);075. }076. 077.}078. 079.private void ScrollFailed()080.{081. scrollToItemAttemptCount++;082. 083. Console.WriteLine("Failed to scroll to {0}. Already tried {1} times", currentScrollToItem.GetHashCode(), scrollToItemAttemptCount);084. 085. if (currentScrollToItem == null)086. {087. Console.WriteLine("Stopped attempting to scroll because currentScrollToItem is NULL");088. scrollToItemAttemptCount = 0;089. return;090. }091. 092. if (scrollToItemAttemptCount < 5)093. {094. GridControl.ScrollIntoViewAsync(currentScrollToItem, Scroll, ScrollFailed);095. }096. else097. {098. currentScrollToItem = null;099. actualScrollToItem = null;100. scrollToItemAttemptCount = 0;101. }102. 103.}01.public List<object> GetParents()02.{03. List<object> result = new List<object>();04. 05. var tmp = Parent;06. 07. // Get all my parents08. while (tmp != null)09. {10. result.Add(tmp);11. 12. tmp = tmp.Parent;13. }14. 15. // Add myself to the list16. result.Add(this);17. 18. // We want the root item to be first in the list and myself last19. result.Reverse();20. 21. return result;22.}
<t:RadRichTextBox Name="txt" Grid.Row="1" FontFamily="inherited" DocumentInheritsDefaultStyleSettings="True"/>
<TextBox Name="html" Grid.Row="2" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"/>01.public MainWindow()02.{03. InitializeComponent();04. 05. txt.ChangeParagraphSpacingAfter(0);06. txt.DocumentContentChanged += TxtOnDocumentContentChanged;07.}08. 09.private void TxtOnDocumentContentChanged(object sender, EventArgs eventArgs)10.{11. UpdateHtml();12.}13. 14.private void UpdateHtml()15.{16. var settings = new HtmlExportSettings();17. settings.DocumentExportLevel = DocumentExportLevel.Fragment;18. settings.ExportStyleMetadata = false;19. settings.StylesExportMode = StylesExportMode.Inline;20. 21. var converter = new HtmlFormatProvider();22. converter.ExportSettings = settings;23. html.Text = converter.Export(txt.Document);24.}<p class="Normal "><span style="font-family: 'Arial';">Original </span>testing<span style="font-family: 'Arial';"> text</span></p>01.<telerikGrid:GridViewToggleButton MinHeight="24" MinWidth="24" IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="2" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerikGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">02. <telerikGrid:GridViewToggleButton.Opacity>03. <Binding Path="IsExpandable" RelativeSource="{RelativeSource TemplatedParent}">04. <Binding.Converter>05. <telerik:BooleanToOpacityConverter/>06. </Binding.Converter>07. </Binding>08. </telerikGrid:GridViewToggleButton.Opacity>09. <telerikGrid:GridViewToggleButton.Visibility>10. <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">11. <Binding.Converter>12. <telerik:BooleanToVisibilityConverter/>13. </Binding.Converter>14. </Binding>15. </telerikGrid:GridViewToggleButton.Visibility>16.</telerikGrid:GridViewToggleButton>17.<Border Grid.Column="2" BorderBrush="#FFB3B3B3" BorderThickness="0,0,1,0" telerikGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">18. <Border.Visibility>19. <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">20. <Binding.Converter>21. <telerik:BooleanToVisibilityConverter/>22. </Binding.Converter>23. </Binding>24. </Border.Visibility>25.</Border>