Telerik Forums
UI for WPF Forum
1 answer
132 views
Hi,

I am trying to set a global header style, but an exception is thrown when I use the following xaml.

<Style TargetType="{x:Type telerik:GridViewHeaderCell}">            
       <Setter Property="Padding" Value="5,0,5,0" />            
</Style>

If I give the style an x:Key="headerCellStyle", and set HeaderCellStyle="{StaticResource headerCellStyle}" , no exception occurs.
I'm using the .net 4 assemblies.

ex.ToString() "System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at Telerik.Windows.Controls.StyleManager.GetTheme(DependencyObject element)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.PrepareHeaderCellStyle()\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnNotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)\r\n   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)\r\n   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)\r\n   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.PrepareHeaderCellStyle()\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnNotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)\r\n   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)\r\n   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)\r\n   at System.Windows.FrameworkElement.UpdateStyleProperty()\r\n   at System.Windows.FrameworkElement.OnInitialized(EventArgs e)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnInitialized(EventArgs e)\r\n   at System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent)\r\n   at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)\r\n   at System.Windows.Media.VisualCollection.Add(Visual visual)\r\n   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)\r\n   at System.Windows.Controls.VirtualizingPanel.AddInternalChild(UIElement child)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.InsertNewContainer(Int32 childIndex, UIElement container)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.GenerateChild(IItemContainerGenerator generator, Size constraint, GridViewColumn column, Int32& childIndex, Size& childSize)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.EnsureColumnHeader(Int32 i, IItemContainerGenerator generator, Size constraint, GridViewColumn column, Size& childSize, List`1 realizedColumnIndices, List`1 realizedColumnDisplayIndices)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.EnsureAtleastOneHeader(IItemContainerGenerator generator, Size constraint, List`1 realizedColumnIndices, List`1 realizedColumnDisplayIndices)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.DetermineRealizedColumnsBlockList(Size constraint)\r\n   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n   at Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(Size constraint)\r\n   at Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(Size availableSize)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Border.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)\r\n   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Border.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Controls.Control.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)\r\n   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.ContextLayoutManager.UpdateLayout()\r\n   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)\r\n   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()\r\n   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)\r\n   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)\r\n   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\r\n   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)"
Vanya Pavlova
Telerik team
 answered on 20 Oct 2010
1 answer
122 views
Hello,

We have a requirement to have a hierarchy grid with the below features 

1) editable.
2) when user edit the data then the summary totals (2-3 rows should be on top of a header for each level) should reflect on the fly.
3) should able to handle around 400 columns with huge number of rows.

do you see any limitations with the WPF GridView?? also can we consider SilverLight control and is it tough enough to handle this?? of is there any better approach?

Please let us know if there any sample code or demo is already out there.

Thanks,
Suman
Vlad
Telerik team
 answered on 20 Oct 2010
3 answers
125 views

I have a radgrid that takes about a second to scroll from page to page.  This is without a page control.  Only a 150 records, which are already in the grid, I am not experiencing a delay from the database.

What the problem seems to be is when I add custom columns.  The last column I added was a custom column that had a radrating control in it.  This made paging 200% worse. 

Should I not use the RadRating control in a grid? 

Is there a setting to make the perfromance better?

Maybe I am make the column in the grid wrong?

At this time, I am most likely going to remove the column as the users are complaining.

<telerik:GridViewDataColumn  DataMemberBinding="{Binding Path=Rating}" Header="Rating" MinWidth="60" Width="SizeToCells">
                       <telerik:GridViewColumn.CellTemplate>
                          <DataTemplate>
                             <telerikInput:RadRating Name="_leadRating"  Value="{Binding Path=Rating,Mode=TwoWay}" UseLayoutRounding="True">
                                <i:Interaction.Triggers>
                                   <i:EventTrigger EventName="ValueChanged">
                                      <cmd:EventToCommand Command="{Binding Path=DataContext.ChangeRatingCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl, AncestorLevel=1}}" CommandParameter="{Binding}" />
                                   </i:EventTrigger>
                                </i:Interaction.Triggers>
                             </telerikInput:RadRating>
                          </DataTemplate>
                       </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewDataColumn>


Vlad
Telerik team
 answered on 20 Oct 2010
1 answer
305 views

I put a PanelBar within a Tab control and, when I resize the my application window, the PanelBar does not follow the resizing and eventually disappears. I tried placing it inside a Grid with a fixed anchors, but this does not work as well.

If I the PanelBar with Grid outside the Tab, it works well, the PanelBar slides on the screen when being resized. But I need the PanelBar to be associated with the Tab. How can I solve this problem?


Looking forward to hearing from you,
Gonçalo Martins

XAML:

<telerik:RadDocking Style="{DynamicResource RadDockingStyleCCR}" IsHitTestVisible="True" Background="#47000000" BorderBrush="{x:Null}" Foreground="DimGray" ClipToBounds="True" MinWidth="1280" MinHeight="1024" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="0,31,0,50">
   <telerik:RadSplitContainer Width="1909.103" Orientation="Vertical" Margin="0,2.625,0,19.25" ClipToBounds="True" InitialPosition="DockedRight">
    <telerik:RadPaneGroup TabOrientation="Vertical" TabStripPlacement="Left" Style="{DynamicResource RadPaneGroupStyle1}" Background="#33000000" BorderBrush="#33FFFFFF" HorizontalAlignment="Left" Width="1903.04" BorderThickness="1" ClipToBounds="True">
     <telerik:RadPane Header="Pane 1" HorizontalAlignment="Left" Width="35" Margin="3,-934.338,0,862.338" CanUserPin="False" Title="Teste" Style="{DynamicResource RadPaneStyleCCR}" BorderBrush="#33FFFFFF" Foreground="DimGray" ClipToBounds="True">
      <telerik:RadPane.Background>
       <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#33FFFFFF" Offset="0"/>
        <GradientStop Color="#C8000000" Offset="1"/>
       </LinearGradientBrush>
      </telerik:RadPane.Background>
      <Grid Height="976" Margin="51.207,8.959,4.5,0" VerticalAlignment="Top">
       <Grid x:Name="Map" Margin="0,-7.166,-2.5,-1.5">
        <telerik:RadMap Name="radMap" Margin="0,0,43.333,0" Background="#47000000" ZoomLevel="5"></telerik:RadMap>
       </Grid>
       <Grid x:Name="PanelBar" Margin="2,1.5,6,0" Height="484" VerticalAlignment="Top">
        <telerik:RadPanelBar x:Name="Panel4Ptos"
         Orientation="Vertical" ExpandMode="Multiple" Foreground="{x:Null}" Height="484" VerticalAlignment="Top" Width="43.33" Margin="1798.501,0,-4.499,0">
         <telerik:RadPanelBarItem x:Name="DetailsPanel1" IsExpanded="{Binding IsDetailsExpanded}" ItemContainerStyle="{StaticResource PanelBarItemSecondLevelTemplateStyle}" Style="{DynamicResource RadPanelBarItemFourPoints}" Foreground="White" BorderBrush="{x:Null}" Background="{x:Null}" IsHitTestVisible="True" Margin="0" Collapsed="DetailsPanel1_Collapsed" Expanded="DetailsPanel1_Expanded" >
          <telerik:RadPanelBarItem.Header>
           <ContentControl Cursor="Hand">
            <TextBlock Foreground="#FFFFFF" Margin="5 4 5 5"/>
           </ContentControl>
          </telerik:RadPanelBarItem.Header>
          <ToggleButton x:Name="tbtClock" Content="ToggleButton" Height="23" Style="{DynamicResource ToggleButtonClock}" Width="23.1" Foreground="#99FFFFFF" Click="tbtClock_Click"/>
          <ToggleButton x:Name="tbtChronometer" Content="ToggleButton" Height="23.3" Style="{DynamicResource ToggleButtonChronometer}" Width="23.1" Foreground="#99FFFFFF"/>
          <ToggleButton x:Name="tbtVessel" Content="ToggleButton" Style="{DynamicResource ToggleButtonVessel}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>
          <ToggleButton x:Name="tbtRoute" Content="ToggleButton" Style="{DynamicResource ToggleButtonRoute}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>
          <ToggleButton x:Name="tbtDoc" Content="ToggleButton" Style="{DynamicResource ToggleButtonDoc}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>
          <ToggleButton x:Name="tbtTarget" Content="ToggleButton" Style="{DynamicResource ToggleButtonTarget}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>
          <ToggleButton x:Name="tbtLabel" Content="ToggleButton" Style="{DynamicResource ToggleButtonLabel}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>
          <ToggleButton x:Name="tbtRuler" Content="ToggleButton" Style="{DynamicResource ToggleButtonRuler}" Width="23.1" Foreground="#99FFFFFF" Height="23"/>

         </telerik:RadPanelBarItem>
        </telerik:RadPanelBar>
       </Grid>

George
Telerik team
 answered on 19 Oct 2010
2 answers
1.2K+ views
Hi,

I was wondering if there is a way to have the grid automatically scroll to the bottom when new items are added to the ObservableCollection that is bound to the ItemsSource.  Basically I want to ensure that the newest item is visible as it is added.

Cheers,
Clint
Clint Singer
Top achievements
Rank 1
 answered on 19 Oct 2010
3 answers
148 views
Hi Fellas,

Need to know whether the Telerik Map control in WPF will support ArcGIS by ESRI (www.esri.com).

Would appreciate any comments and/or technote in how to get this working.

Thanks...Bob

Bob McCormick
Lockheed Martin
Llewellyn
Top achievements
Rank 1
 answered on 19 Oct 2010
3 answers
808 views
Hi,

Im using radgridview in a user control and on trying to add the usercontrol at runtime to the main window leads to the following error .
Please let me know the reason for getting the error in the radgridview declaration statement in xaml.


EXCEPTION

'Set connectionId threw an exception.' Line number '63' and line position '22'.

INNER EXCEPTION

{"[A]Telerik.Windows.Controls.RadGridView cannot be cast to [B]Telerik.Windows.Controls.RadGridView. Type A originates from 'Telerik.Windows.Controls.GridView, Version=2010.2.714.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'LoadFrom' at location 'C:\\....\\Telerik.Windows.Controls.GridView.dll'. Type B originates from 'Telerik.Windows.Controls.GridView, Version=2010.2.714.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'Default' at location 'C:\\....\\Telerik.Windows.Controls.GridView.dll'."}
Hristo
Telerik team
 answered on 19 Oct 2010
1 answer
135 views
Hi,

I use RadTreeView to display the content in a hierarchical structure. An item in the tree is dragged onto another control which is working. The thing which I want to disable is altering the structure of the tree by dragging the items within the tree. How can I do this?

The tree items are bound to a collection & use ItemTemplate to display the items.

Thank you.
Hristo
Telerik team
 answered on 19 Oct 2010
1 answer
82 views
Hello,

Can you provide me with guidance how to create Grid just like Ms Access.
Insert row is always visible on the top of the grid and once user leaves a row in insert mode new insert row is created.

I am using MVVM

thanks
Pavel Pavlov
Telerik team
 answered on 19 Oct 2010
1 answer
1.0K+ views
Hi,

I am using RadTreeView to show a Level Hierarchy. I have a textbox to enter search string and a "Search" button on the screen. When user enters the string and clicks "Search" button, the observable collection should be filtered and the Level that contains the entered string should be shown with their upper hierarchy only upto root.

I have made a class "Level" which I am using to implement Level hierarchy.

Here is the code for class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Collections.ObjectModel;

 

namespace RadTreeViewSample

{

    class Level

    {

        public Level(int id, string name, Level parentLevel)

        {

            this.ID = id;

            this.Name = name;

            this.ParentLevel = parentLevel;

        }

 

        public int ID { get; set; }

        public string Name { get; set; }

        public Level ParentLevel { get; set; }

        public ObservableCollection<Level> ChildLevels { get; set; }

 

        public static ObservableCollection<Level> SampleLevelList(int level, Level parentOrg)

        {

            ObservableCollection<Level> orgList = new ObservableCollection<Level>();

            for (int i = 0; i < 5; i++)

            {

                Level org = new Level(i, "Level " + level.ToString() + "-" + i.ToString(), parentOrg);

                if (level > 0)

                    org.ChildLevels = SampleLevelList(level - 1, org);

                orgList.Add(org);

            }

            return orgList;

        }

    }

 

}

 

 

 

 






Here is the xaml

<
Window x:Class="RadTreeViewSample.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

        xmlns:telerikTV="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

        Title="MainWindow" Height="350" Width="525">

    <Window.Resources>

        <HierarchicalDataTemplate x:Key="items" ItemsSource="{Binding ChildLevels}">

            <TextBlock Text="{Binding Name}"/>

        </HierarchicalDataTemplate>

    </Window.Resources>

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="auto"/>

            <RowDefinition />

        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>

            <ColumnDefinition />

            <ColumnDefinition Width="auto"/>

        </Grid.ColumnDefinitions>

        <TextBox x:Name="txtOrgname" Grid.Row="0" Grid.Column="0" Margin="5" />

        <Button x:Name="btnSearch" Content="Search" Width="80" Grid.Row="0" Grid.Column="1" Margin="5" Click="btnSearch_Click"/>

        <telerik:RadTreeView x:Name="rtvLevel" ItemTemplate="{StaticResource items}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5"/>

    </Grid>

</Window>

 

 

 



Here is my code-behind

 


using
System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using System.Collections.ObjectModel;

 

namespace RadTreeViewSample

{

    /// <summary>

    /// Interaction logic for MainWindow.xaml

    /// </summary>

    public partial class MainWindow : Window

    {

        private ObservableCollection<Level> LevelList;

        public MainWindow()

        {

            InitializeComponent();

 

            ObservableCollection<Level> LevelList = Level.SampleLevelList(5, null);

            rtvLevel.ItemsSource = LevelList;

        }

 

        private void btnSearch_Click(object sender, RoutedEventArgs e)

        {

What should I write here to filter the LevelList, so that only element that contains search string are show

       in treeview with their upper hierarchy only upto root ?

        }

 

    }

}

 

 

 

 

Kiril Stanoev
Telerik team
 answered on 19 Oct 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?