Telerik Forums
UI for WPF Forum
6 answers
393 views
hi guys,

i've been trying out the RadDock control via "RadControls_for_WPF_2009_3_1314_TRIAL.msi" for the past two and something weeks for my company, we're looking to buy docking capabilities to our WPF .Net 3.5 app.
it's looks great, feels great, and easy to program with - NICE work you guys.

some things that i need some help with trying the control:

my basic WPF app - in XAML: i've put a dock panel in a window inside a grid. added an expander (RadExpander of course) docked to the right side. added two RadDock controls one of them docked to the Top and one to the Bottom.

1. i had to set the DockPanel.Dock attached property on both RadDock controls - 
when i set only one to dock to the Top and nothing on the other one - the RadDock didn't show... although it should make the second RadDock fill the available space in the panel, no?

2. i want to be able to resize each of the RadDock controls, 'cause now i can't really control their size as a user on run time. i thought about putting them into a grid with splitter between them, but is that the best way?

3. in that same example - when i drag a pane from the top-docked RadDock control - moving it downwards makes it "hide" behind the bottom-docked RadDock control (that's normal i guess?) but dragging it to the right i can move it, still floated, on top of the RadExpander, it's looks odd 'cause it's hiding behind the bottom-docked RadDock control but on top of the RadExpander,
any ideas of making it look better?

4. the Close button on a pane makes it Hidden (that's great!) but in our app we have the need sometimes to create a lot of floated panes that the user can close and open new ones, i wanna know if there is a way to "really" close the pane i.e. get ride of it, dispose it - whatever, my fear is from large memory usage because some of these panes store lots of data and controls in them,
i'm working on trying big quantities of data and control in panes to see what happens - thought about asking first how to deal with it.

hope i was able to explain myself clearly,
thank you so much in advance.

Lior.

Miroslav Nedyalkov
Telerik team
 answered on 18 Feb 2010
3 answers
197 views
I have a RadGridView bound to a generic ObservableCollection of a class I use in my application.
The class has a public property called ID (int)

I created a sort descriptor to make sure the data is sorted using the ID field
Code:
<Telerik:RadGridView.SortDescriptors>
      <Telerik_Windows_Data:SortDescriptor  Member="ID" SortDirection="Descending"/>          
</Telerik:RadGridView.SortDescriptors>

While working at run-time the code generates an Expression Blend 3 error:
"Invalid property or field - 'ID' for type Object"

I'd appreciate any input on why.


Nils
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
94 views
Hi,

I have a grid and am using MVVM Pattern. Now i would like to change a column value in any row and do a short cut to save (like Ctrl+S), then that column value should be updated for all other rows of that column.
Is there any way to achieve this requirement.

Any help is much appreciated.

Regards

Sujith
Vlad
Telerik team
 answered on 18 Feb 2010
3 answers
299 views
I'm looking for any guidelines for optimization of the RadGridView.  Specifically, I'd like to know if such documentation exists which specifies grid options which might be "performance-heavy".  Even though you can load millions of rows into the grid, you still see [the familiar WPF] large spikes in CPU.   I'm interested in turning off all non-essential functions to get more performance out of the grid, and am looking for features or settings which ppl. feel helped the overall performance.   So far I turned off sorting, highlighting/selection, etc.  Each helps / just looking for a general set of principles to really optimize perf.
wpfPerf
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
134 views
Hello,

I'm using the WPF Carousel in my application and bind the ItemsSource und SelectedItem properties. But when the carousel is loaded, the SelectedItem is not the one the carousel shows in front of it. I've looked at the SelectedItem property in the Loaded event and it was set correctly. I've tried many different ways to achive this:

foreach (CarouselItem item in carousel.Panel.Children)
{
   if (item.Item == carousel.SelectedItem)
   {
      item.BringIntoView();
   }
}

carousel.SetIsSelected(carousel.SelectedItem, true);
carousel.SetIsCurrent(carousel.SelectedItem, true);
this.carousel.BringDataItemIntoView(carousel.SelectedItem);

carousel.CurrentItem = carousel.SelectedItem;


But none of them worked. How can I achieve it?


Milan
Telerik team
 answered on 17 Feb 2010
1 answer
185 views
Hi,

I want to slide out and show the docking RadDocumentPane automatically from my code. Like i have scenario where if the RadDocumentPane is slided in or user closed it and if I press show button on the screen, it should show it up or slide out outside.

Can you please suggest the proper way.

Thanks,
Jigar
Konstantina
Telerik team
 answered on 17 Feb 2010
5 answers
157 views

Hi

There is a problem in the RadTreeView.

When you rename a node, and the name is longer then the tree’s container width, the tree shakes.

Please try renamning a node with a long name with many ‘a’.

Then rename again the same way, move to a node that has children and the tree will start shaking.

 

Thanks

 

 

Lior Aloni

Kiril Stanoev
Telerik team
 answered on 17 Feb 2010
1 answer
180 views
I subclassed from WPF RadTreeView and created a TreeListView and TreeListViewItem.  I have various controls inside the TreeListViewItem(RadTreeViewItem) that are not functioning properly when I need to interact with them through a mouse drag (ie. selecting text in TextBox, or moving the scrollbar on a combobox dropdown).  The treeview appears to hijack the mouse drag event.  Any ideas on how to fix this? I have attached a jpeg of the control and the problem areas.
Bobi
Telerik team
 answered on 17 Feb 2010
1 answer
157 views
Hi ,

I had changed the Control Template of the tree (see the attached picture) but i had defficulties to add the lines. the code below is the tree template:

any suggestions?


<UserControl 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:d="http://schemas.microsoft.com/expression/blend/2008"   
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
             x:Class="GSTAT.Xeligence.DTM.Client.DTMTemplate" 
             Loaded="UserControl_Loaded" mc:Ignorable="d" 
             xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework">  
    <UserControl.Resources> 
        <ControlTemplate TargetType="{x:Type telerik:RadTreeViewItem}" x:Key="TreeViewItemDefaultTemplate">  
            <ControlTemplate.Triggers> 
                <Trigger Property="IsExpanded" Value="True">  
                    <Trigger.EnterActions> 
                        <BeginStoryboard> 
                            <Storyboard> 
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" 
                                            Storyboard.TargetProperty="Visibility" Duration="0">  
                                    <DiscreteObjectKeyFrame KeyTime="0">  
                                        <DiscreteObjectKeyFrame.Value> 
                                            <Visibility>Visible</Visibility> 
                                        </DiscreteObjectKeyFrame.Value> 
                                    </DiscreteObjectKeyFrame> 
                                </ObjectAnimationUsingKeyFrames> 
                                <DoubleAnimation Storyboard.TargetName="ItemsHost" 
                                            Storyboard.TargetProperty="Opacity" From="0.1" To="1.0" 
                                            Duration="0:0:0.2" /> 
                            </Storyboard> 
                        </BeginStoryboard> 
                    </Trigger.EnterActions> 
                    <Trigger.ExitActions> 
                        <BeginStoryboard> 
                            <Storyboard> 
                                <DoubleAnimation Storyboard.TargetName="ItemsHost" 
                                            Storyboard.TargetProperty="Opacity" From="1" To="0.1" 
                                            Duration="0:0:0.2" /> 
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" 
                                            Storyboard.TargetProperty="Visibility" Duration="0" 
                                            BeginTime="0:0:0.2">  
                                    <DiscreteObjectKeyFrame KeyTime="0">  
                                        <DiscreteObjectKeyFrame.Value> 
                                            <Visibility>Collapsed</Visibility> 
                                        </DiscreteObjectKeyFrame.Value> 
                                    </DiscreteObjectKeyFrame> 
                                </ObjectAnimationUsingKeyFrames> 
                            </Storyboard> 
                        </BeginStoryboard> 
                    </Trigger.ExitActions> 
                </Trigger> 
            </ControlTemplate.Triggers> 
            <Grid Height="Auto" VerticalAlignment="Center" Background="Beige" > 
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition Width="Auto" /> 
                    <ColumnDefinition Width="Auto" /> 
                    <ColumnDefinition Width="Auto" /> 
                </Grid.ColumnDefinitions> 
                <Grid.RowDefinitions> 
                    <RowDefinition Height="Auto" ></RowDefinition>  
                </Grid.RowDefinitions> 
                  
                <!--<Rectangle x:Name="VerticalLine" Fill="Blue" Grid.Column="0" Height="2"></Rectangle> 
                <Rectangle x:Name="HorizontalLine" Fill="Black" Grid.Column="0" Width="2"></Rectangle>--> 
 
                <Grid Grid.Column="1" x:Name="HeaderRow"  Height="Auto" Grid.Row="0" VerticalAlignment="Center" Background="Bisque">  
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                    </Grid.ColumnDefinitions> 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="Auto"></RowDefinition> 
                    </Grid.RowDefinitions> 
 
                    <ToggleButton x:Name="Expander" Margin="0,0,0,0" Grid.Column="0"></ToggleButton> 
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">  
                        <Border HorizontalAlignment="Center"   
                                            VerticalAlignment="Center"   
                                            CornerRadius="3"   
                                            Background="{DynamicResource BrushWindowDarkGrayBG}"   
                                            Padding="3">  
                            <ContentControl x:Name="Header" 
                                            Content="{TemplateBinding Header}" 
                                            ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                            Width="86.487" Height="13.277" Foreground="White" /> 
                        </Border> 
                    </StackPanel> 
                    <!--<StackPanel x:Name="IndentContainer" Orientation="Horizontal" />--> 
                    <StackPanel x:Name="LoadingVisual" Orientation="Horizontal" /> 
                </Grid> 
                <ItemsPresenter x:Name="ItemsHost" Grid.Column="2" Visibility="Collapsed" Height="Auto" VerticalAlignment="Center">  
                </ItemsPresenter> 
            </Grid> 
        </ControlTemplate> 
 
        <Style TargetType="ToggleButton" x:Key="ExpanderStyle">  
            <Setter Property="IsEnabled" Value="True" /> 
            <Setter Property="IsTabStop" Value="False" /> 
            <Setter Property="Cursor" Value="Hand" /> 
            <Setter Property="Template">  
                <Setter.Value> 
                    <ControlTemplate TargetType="ToggleButton">  
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsChecked" Value="True">  
                                <Trigger.EnterActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="ExpandedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="CollapsedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.EnterActions> 
                                <Trigger.ExitActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="ExpandedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="CollapsedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.ExitActions> 
                            </Trigger> 
                            <Trigger Property="IsEnabled" Value="False">  
                                <Trigger.EnterActions> 
                                    <BeginStoryboard> 
                                        <Storyboard> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="ExpandedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                            <DoubleAnimation Duration="0:0:0.2" 
                                                        Storyboard.TargetName="CollapsedStates" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                        </Storyboard> 
                                    </BeginStoryboard> 
                                </Trigger.EnterActions> 
                            </Trigger> 
                        </ControlTemplate.Triggers> 
                        <Grid> 
                            <Grid x:Name="CollapsedStates">  
                                <Ellipse x:Name="CollapsedVisual" Width="10" Height="10" Fill="CornflowerBlue"></Ellipse> 
                            </Grid> 
                            <Grid x:Name="ExpandedStates">  
                                <Ellipse x:Name="ExpandedVisual" Width="10" Height="10" Fill="BurlyWood"></Ellipse> 
                            </Grid> 
                        </Grid> 
 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
 
        <Style TargetType="{x:Type telerik:RadTreeViewItem}" x:Key="RadTreeViewItemStyle">  
            <Setter Property="Template" Value="{StaticResource TreeViewItemDefaultTemplate}" /> 
            <Setter Property="IsExpanded" Value="True" /> 
            <Setter Property="ItemsPanel">  
                <Setter.Value> 
                    <ItemsPanelTemplate> 
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center"/>  
                    </ItemsPanelTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
 
    </UserControl.Resources> 
 
    <Grid> 
                    <telerik:RadTreeView  
                        x:Name="DTMTree" 
                        AllowDrop="True" 
                        IsDragDropEnabled="True" 
                        IsLineEnabled="True" 
                        ExpanderStyle="{StaticResource ExpanderStyle}" 
                        ItemContainerStyle="{StaticResource RadTreeViewItemStyle}" 
                        IsExpandOnSingleClickEnabled="True" 
                        Selected="DTMTree_Selected" 
                        MouseDoubleClick="DTMTree_MouseDoubleClick" 
                        SelectionChanged="DTMTree_SelectionChanged"   
                        Margin="5,0,0,0"   
                        IsRootLinesEnabled="True">  
 
                        <telerik:RadTreeView.ItemsPanel> 
                            <ItemsPanelTemplate> 
                                <StackPanel VerticalAlignment="Center" 
                                    Orientation="Horizontal" 
                                    HorizontalAlignment="Left" /> 
                            </ItemsPanelTemplate> 
                        </telerik:RadTreeView.ItemsPanel> 
 
                        <telerik:RadTreeViewItem Header="Root" 
                            AllowDrop="True"   
                            ItemContainerStyle="{StaticResource RadTreeViewItemStyle}" ForceCursor="True">  
                            <telerik:RadTreeViewItem Header="A" 
                                ItemContainerStyle="{StaticResource RadTreeViewItemStyle}"/>  
                            <telerik:RadTreeViewItem Header="B" 
                                ItemContainerStyle="{StaticResource RadTreeViewItemStyle}"/>  
                        </telerik:RadTreeViewItem> 
                    </telerik:RadTreeView> 
    </Grid> 
</UserControl> 
 
Dimitrina
Telerik team
 answered on 17 Feb 2010
3 answers
133 views
    public partial class MainWindow : Window 
    { 
        public MainWindow() 
        { 
            InitializeComponent(); 
            (Resources["DataSource"as RadTreeViewSampleData).SelectedItem = (radTreeView.ItemsSource as IEnumerable<League>).LastOrDefault(); 
        } 
    } 
    public class League : DependencyObject 
    { 
        public League(string name) 
        { 
            this.Name = name; 
            this.Leagues = new List<League>(); 
        } 
 
        public string Name 
        { 
            get
            set
        } 
 
        public List<League> Leagues 
        { 
            get
            set
        } 
    } 
 
    public class RadTreeViewSampleData : DependencyObject 
    { 
        /// <summary> 
        /// Identifies the SelectedItem dependency property. 
        /// </summary> 
        public static readonly DependencyProperty SelectedItemProperty = DependencyProperty.Register("SelectedItem"typeof(League), typeof(RadTreeViewSampleData)); 
 
        /// <summary> 
        /// Gets or sets SelectedItem.  This is a dependency property. 
        /// </summary> 
        public League SelectedItem 
        { 
            get { return (League)GetValue(SelectedItemProperty); } 
            set { SetValue(SelectedItemProperty, value); } 
        } 
 
        public RadTreeViewSampleData() 
        { 
            this.InitializeLeaguesDataSource(); 
        } 
 
        public List<League> LeaguesDataSource 
        { 
            get
            set
        } 
 
        private void InitializeLeaguesDataSource() 
        { 
            this.LeaguesDataSource = new List<League>(); 
            League l; 
            League d; 
            this.LeaguesDataSource.Add(l = new League("League A")); 
        } 
    } 
<Window.Resources> 
        <local:RadTreeViewSampleData x:Key="DataSource"/> 
    </Window.Resources> 
    <telerik:RadTreeView x:Name="radTreeView" ItemsSource="{Binding Path=LeaguesDataSource, Source={StaticResource DataSource}}" SelectedItem="{Binding Path=SelectedItem, Source={StaticResource DataSource}, Mode=TwoWay}"
        <telerik:RadTreeView.ItemTemplate> 
            <HierarchicalDataTemplate ItemsSource="{Binding Path=Leagues}"
                <TextBlock Text="{Binding Path=Name}" /> 
            </HierarchicalDataTemplate> 
        </telerik:RadTreeView.ItemTemplate> 
    </telerik:RadTreeView> 
The SelectedItem is set properly but does not have the selection brush applied appropriately to its container.
Bobi
Telerik team
 answered on 17 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?