Telerik Forums
UI for WPF Forum
3 answers
1.4K+ views
We have a WPF application using prism and regions.

The Shell looks like this.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
 
    <billingCustomControls:BillingToaster Margin="0,0,-490,0" />
 
    <ContentControl Grid.Row="0"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    prism:RegionManager.RegionName="{x:Static pll:RegionNames.BannerRegion}"
                    VerticalAlignment="Top" />
 
    <Grid Grid.Row="1">
 
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
 
        <StackPanel Grid.Column="0">
 
            <ContentControl Margin="0"
                            HorizontalContentAlignment="Stretch"
                            VerticalContentAlignment="Stretch"
                            prism:RegionManager.RegionName="{x:Static pll:RegionNames.UserDetailsRegion}" />
 
            <Separator />
 
            <ItemsControl Margin="0"
                          HorizontalContentAlignment="Stretch"
                          VerticalContentAlignment="Stretch"
                          prism:RegionManager.RegionName="{x:Static pll:RegionNames.TaskBarRegion}" />
 
            <ContentControl Margin="0"
                            HorizontalContentAlignment="Stretch"
                            VerticalContentAlignment="Stretch"
                            MinHeight="200"
                            MinWidth="100"
                            prism:RegionManager.RegionName="{x:Static pll:RegionNames.FooterRegion}"
                            VerticalAlignment="Bottom" />
 
        </StackPanel>
 
        <Grid Grid.Column="1">
 
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
 
            <ContentControl Grid.Row="0"
                            HorizontalContentAlignment="Stretch"
                            VerticalContentAlignment="Stretch"
                            Margin="2,2,2,2"
                            prism:RegionManager.RegionName="{x:Static pll:RegionNames.MenuBarRegion}" />
 
            <ContentControl Grid.Row="1"
                            HorizontalContentAlignment="Stretch"
                            VerticalContentAlignment="Stretch"
                            Margin="2,2,2,6"
                            prism:RegionManager.RegionName="{x:Static pll:RegionNames.BreadCrumbRegion}" />
 
            <ContentControl Grid.Row="2"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"
                            VerticalContentAlignment="Stretch"
                            Margin="2,2,2,2"
                            prism:RegionManager.RegionName="{x:Static pll:RegionNames.WorkSpaceRegion}" />
 
        </Grid>
 
    </Grid>
 
</Grid>

We load a user control in the WorkSpaceRegion which contains a RadGridView.

But when the grid is displayed it always has the maximum width needed to display the entire grid.

How can we get the RadGridView to autosize so that it takes the available width of the main window instead of running of the screen?

Regards,
Peter
Dimitrina
Telerik team
 answered on 30 Mar 2015
1 answer
119 views
 

Hi ! Could anyone please help me on the below issue:

I have a rad grid view and rad data pager, RadGridView control contains a grid view select column with check box in it (checked when an item in grid view is selected).
Used RadDataPager for paging, when we select items from page 1 and move to page 2 and again to page 1 the selected items are getting cleared where as it should be still in selected mode 

Please let me know how can i proceed with this when switching between pages using paging  in rad grid view
Dimitrina
Telerik team
 answered on 30 Mar 2015
1 answer
301 views
Hi,

I'm using the RadTileView with the RadFluidContentControl as explained in this article by telerik. It works fine on my dev computer and another computer that is supposed to be pretty slow.
When I try it onto the latest MS Surface Pro3 (i3, 64GB ssd) the animation in my TileView is lagging a lot, and I only display 4 items !!!!
Am I doing something wrong ?

Here is my XAML code below:
001.<Style x:Key="RadTileViewItemStyle" TargetType="{x:Type telerik:RadTileViewItem}">
002.    <Setter Property="TileState" Value="{Binding ContentState, Mode=TwoWay, Converter={StaticResource tileStateConverter}}" />
003.    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
004.    <Setter Property="VerticalContentAlignment" Value="Stretch" />
005.    <Setter Property="SnapsToDevicePixels" Value="True" />
006.    <Setter Property="Template">
007.        <Setter.Value>
008.            <ControlTemplate TargetType="{x:Type telerik:RadTileViewItem}">
009.                <Grid>
010.                    <Border x:Name="outerBorder"
011.                        Margin="{TemplateBinding Padding}"
012.                         
013.                        BorderBrush="{TemplateBinding BorderBrush}"
014.                        BorderThickness="{TemplateBinding BorderThickness}"
015.                        CornerRadius="7">
016.                        <Border.Background>
017.                            <RadialGradientBrush RadiusX="1" RadiusY="1" GradientOrigin="0.5,0.5" Opacity="0.75">
018.                                <GradientStop Color="White" Offset="0" ></GradientStop>
019.                                <GradientStop Color="Gray" Offset="1" ></GradientStop>
020.                            </RadialGradientBrush>
021.                        </Border.Background>
022.                        <Border.Effect>
023.                            <DropShadowEffect BlurRadius="2" Color="#888" Direction="-45" ShadowDepth="2" />
024.                        </Border.Effect>
025.                        <Border x:Name="outerContainer"
026.                            Background="Transparent">
027.                            <telerik:RadFluidContentControl ContentChangeMode="Manual" State="{Binding ContentState, Converter={StaticResource fluidContentStateConverter}}">
028.                                <telerik:RadFluidContentControl.SmallContent>
029.                                    <telerik:RadButton Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False">
030.                                        <Button.Template>
031.                                            <ControlTemplate TargetType="{x:Type Button}">
032.                                                <Grid>
033.                                                    <Image Stretch="Uniform" Cursor="Hand">
034.                                                        <Image.Style>
035.                                                            <Style>
036.                                                                <Setter Property="Image.Source" Value="{Binding SetupImage}" />
037.                                                                <Setter Property="UIElement.Opacity" Value=".4"/>
038.                                                                <Style.Triggers>
039.                                                                    <Trigger Property="UIElement.IsMouseOver" Value="True">
040.                                                                        <Setter Property="Image.Source" Value="{Binding SetupImage}" />
041.                                                                        <Setter Property="UIElement.Opacity" Value="1"/>
042.                                                                    </Trigger>
043.                                                                </Style.Triggers>
044.                                                            </Style>
045.                                                        </Image.Style>
046.                                                    </Image>
047.                                                    <Viewbox Margin="20">
048.                                                        <TextBlock Text="{Binding Name}" FontFamily="Calibri" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center">
049.                                                            <TextBlock.Effect>
050.                                                                <DropShadowEffect BlurRadius="2" Color="#FFF" Direction="-45" ShadowDepth=".5" />
051.                                                            </TextBlock.Effect>
052.                                                        </TextBlock>
053.                                                    </Viewbox>
054.                                                </Grid>
055.                                            </ControlTemplate>
056.                                        </Button.Template>
057.                                    </telerik:RadButton>
058.                                </telerik:RadFluidContentControl.SmallContent>
059.                                <telerik:RadFluidContentControl.Content>
060.                                    <telerik:RadButton Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False">
061.                                        <Button.Template>
062.                                            <ControlTemplate TargetType="{x:Type Button}">
063.                                                <Grid Cursor="Hand">
064.                                                    <Image >
065.                                                        <Image.Style>
066.                                                            <Style>
067.                                                                <Setter Property="Image.Source" Value="{Binding SetupImage}" />
068.                                                                <Setter Property="UIElement.Opacity" Value=".4"/>
069.                                                                <Style.Triggers>
070.                                                                    <Trigger Property="UIElement.IsMouseOver" Value="True">
071.                                                                        <Setter Property="Image.Source" Value="{Binding SetupImage}" />
072.                                                                        <Setter Property="UIElement.Opacity" Value="1"/>
073.                                                                    </Trigger>
074.                                                                </Style.Triggers>
075.                                                            </Style>
076.                                                        </Image.Style>
077.                                                    </Image>
078.                                                    <Viewbox Margin="40">
079.                                                        <TextBlock Text="{Binding Name}" FontFamily="Calibri" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center">
080.                                                            <TextBlock.Effect>
081.                                                                <DropShadowEffect BlurRadius="4" Color="#FFF" Direction="-45" ShadowDepth=".5" />
082.                                                            </TextBlock.Effect>
083.                                                        </TextBlock>
084.                                                    </Viewbox>
085.                                                </Grid>
086.                                            </ControlTemplate>
087.                                        </Button.Template>
088.                                    </telerik:RadButton>
089.                                </telerik:RadFluidContentControl.Content>
090.                                <telerik:RadFluidContentControl.LargeContent>
091.                                    <Grid>
092.                                        <Grid.Background>
093.                                            <ImageBrush ImageSource="{Binding SetupImage}" Opacity="0.35" Stretch="UniformToFill" TileMode="None"></ImageBrush>
094.                                        </Grid.Background>
095.                                        <Grid.RowDefinitions>
096.                                            <RowDefinition Height="Auto"></RowDefinition>
097.                                            <RowDefinition Height="*"></RowDefinition>
098.                                            <RowDefinition Height="Auto"></RowDefinition>
099.                                        </Grid.RowDefinitions>
100.                                        <TextBlock Grid.Row="0" Padding="10" Text="{Binding Version}" HorizontalAlignment="Right" VerticalAlignment="Top"></TextBlock>
101.                                        <TextBlock Grid.Row="0" Padding="10" FontFamily="Calibri" FontSize="20" FontWeight="Bold" Text="{Binding Name}" HorizontalAlignment="Left"></TextBlock>
102.                                        <telerik:RadButton Grid.Row="1" Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False" Cursor="Hand">
103.                                            <Button.Template>
104.                                                <ControlTemplate TargetType="{x:Type Button}">
105.                                                    <TextBlock Padding="10" TextWrapping="Wrap" Text="{Binding Description}" FontFamily="Calibri" Foreground="Black" FontSize="12pt">
106.                                                    </TextBlock>
107.                                                </ControlTemplate>
108.                                            </Button.Template>
109.                                        </telerik:RadButton>
110.                                        <Border Grid.Row="2" BorderBrush="White" BorderThickness="2" CornerRadius="6" Cursor="Hand" Width="120" Height="60" Margin="0,0,0,10">
111.                                            <Border.Style>
112.                                                <Style>
113.                                                    <Setter Property="Border.Background" Value="LightGray"></Setter>
114.                                                    <Setter Property="UIElement.Opacity" Value="0.7"></Setter>
115.                                                    <Style.Triggers>
116.                                                        <Trigger Property="UIElement.IsMouseOver" Value="True">
117.                                                            <Setter Property="UIElement.Opacity" Value="1"/>
118.                                                        </Trigger>
119.                                                    </Style.Triggers>
120.                                                </Style>
121.                                            </Border.Style>
122.                                            <Button Height="Auto" Width="Auto" OverridesDefaultStyle="False" ClickMode="Release" Command="{Binding DebugCommand}" CommandParameter="{Binding}">
123.                                                <Button.Template>
124.                                                    <ControlTemplate TargetType="{x:Type Button}">
125.                                                        <Viewbox>
126.                                                            <TextBlock Text="Run"></TextBlock>
127.                                                        </Viewbox>
128.                                                    </ControlTemplate>
129.                                                </Button.Template>
130.                                            </Button>
131.                                        </Border>
132.                                    </Grid>
133.                                </telerik:RadFluidContentControl.LargeContent>
134.                            </telerik:RadFluidContentControl>
135.                        </Border>
136.                    </Border>
137.                </Grid>
138.            </ControlTemplate>
139.        </Setter.Value>
140.    </Setter>
141.</Style>



And my RadTileView:
01.<telerik:RadTileView x:Name="taskTileList" Grid.Row="1" VerticalAlignment="Top" ColumnsCount="2" ColumnWidth=".5*" IsAutoScrollingEnabled="False" IsDockingEnabled="False" Padding="30"
02.                     ItemsSource="{Binding Tasks}"
03.                     ItemTemplate="{StaticResource taskHeaderTemplate}"
04.                     ItemContainerStyle="{StaticResource RadTileViewItemStyle}"
05.                     IsItemDraggingEnabled="False"
06.                     MinimizedColumnWidth="210"                                    
07.                     MinimizedRowHeight="140"
08.                     MinimizedItemsPosition="Right"
09.                     TileStateChangeTrigger="SingleClick"
10.                     PreservePositionWhenMaximized="True">
11.</telerik:RadTileView>



What can I do to improve those performance ? Should I give up on the opacity < 1 and gradients ?

Cheers,

Chris

 

Kiril Vandov
Telerik team
 answered on 30 Mar 2015
9 answers
225 views
Hi,

I have an application built using MVVM pattern and Caliburn, which displays two TreeListView in parallel using Virtualization.
When I set the IsExpandedBinding property, then performances (scrolling down ...) are really bad.
When Tree Lines are hidden, then performances are only acceptable.

I also have another need: the background color of each row should change based on a binding (Status property).
I tried to achieve this with a RowStyleSelector (not sure I should do it like this with lightweight templates) but performance are incredibly bad (Especially when dragging the Scrollbar or when using Page Up/Down keys)...

Note that the test application displays a sample data source but, but be aware that in real life, this data source can be really big. Right now, the TreeListView is simply not usable.

How I improve the performance? What do I do wrong ?

Please find attached by test solution.
You can turn on/off tree  lines and row styles with:
<Setter Property="RowStyleSelector" Value="{StaticResource DiffRowStyleSelector}" />
<Setter Property="TreeLinesVisibility" Value="Hidden" />

Thanks for your help

Lorenz
Top achievements
Rank 1
 answered on 30 Mar 2015
2 answers
204 views
I'm using the version 2013.3.1202.40

If a user copies a line (CRTL-C) and pastes it (CTRL-V), there is a problem when one of the column's contents is empty. All contents are shifted “to the left”, simply ignoring the empty column.

So, if we have something like "Text;;;End" it would be pasted as "Text;End"
Attila
Top achievements
Rank 1
 answered on 30 Mar 2015
4 answers
208 views
Hi,

I want to change PropertyGrid font-family, Code like this:

<telerik:RadPropertyGrid Name="squidProperties" Grid.Row="1" RenderMode="Flat"
           AutoGeneratePropertyDefinitions="False"
                        DescriptionPanelVisibility="Collapsed"                        
          FontFamily="Microsoft YaHei" Item="{Binding testtest}" LabelColumnWidth="100"
          Visibility="{Binding test}" />

it's not working.

The textblock's(PART_FieldLabelN) font-family is still Segoe UI.
haochen
Top achievements
Rank 1
 answered on 30 Mar 2015
5 answers
223 views
Hello,

I'm experiencing a memory leak when using RadPropertyGrid in a project targeting .Net Framework 4.
I would attach a sample project to demonstrate the issue, but apparently only images can be attached.
I'm able to reproduce the issue with a simple project containing a main window with a button opening a new window with only a RadPropertyGrid, with Item set to a simple POCO object with 2 string properties. The window is not released when closed.
Dimitrina
Telerik team
 answered on 30 Mar 2015
2 answers
132 views
Hi there, 

we are currently working on a wrapper control of your RadChartView RadCartesianChart that contains a DateTimeContinuousAxis. Out clients should be able to modify the FontSize of it, so we bond it to our DependencyProperty AxisFontSize:

<telerik:RadCartesianChart.HorizontalAxis>
  <telerik:DateTimeContinuousAxis x:Name="dateTimeContinuousAxis" PlotMode="OnTicks" LabelFitMode="Rotate" MajorStepUnit="Second"
                                                LabelFormat="HH:mm:ss" FontSize="{Binding AxisFontSize, FallbackValue=14}" />
</telerik:RadCartesianChart.HorizontalAxis>

When the client changes the AxisFontSize on design or run time something strange happens: https://dl.dropboxusercontent.com/u/55589036/Pictures/Animated%20Screenshots/20150326_1440.gif

Now we experimented a bit to get rid of this problem. In the Changed-Event of the AxisFontSize we tried to re-add entirely new Series with entirely new data plots in a different time range than before. Nothing changes, because your control seems to keep the old labels for resource purposes. We even tried to call UpdateLayout() and InvalidateVisual() in our Update() method that will be called in the Changed-Event.

Now to up the stakes even more we got two other DependencyProperties on our control:
- TimeRange: This enum value (seconds) defines the time range of the DateTimeContinuousAxis. When this is changed we call our Update() method, too, to re-add all Series with new dummy or live plot data in the Changed-Event.
- TimeTickCount: This defines the number of time ticks on the X axis. When changed we calculate the new MajorStep of the X axis and set it to the DateTimeContinuousAxis MajorStep property.

When we change the AxisFontSize and finally change one of the other DependencyProperties it's getting even more weird: https://dl.dropboxusercontent.com/u/55589036/Pictures/Animated%20Screenshots/20150326_1441.gif


How can we fix this problem or bypass the bug? Is there at least a way to force your control to remove and re-add the labels to get rid of this problem?
Martin
Top achievements
Rank 1
 answered on 30 Mar 2015
1 answer
91 views
Hello,

Sometimes unintentionally clicked on the group header and collapsed group, How can prevent collapsed group ? or collapse like expander if clicked on the button expand or collapse?
Maya
Telerik team
 answered on 30 Mar 2015
1 answer
151 views
Hi,

in my application I have multiple RadTablControls and I would like to change the height of all TabItem... How it's possible to do it through styling???

Thank's
Alain
Evgenia
Telerik team
 answered on 30 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?