Telerik Forums
UI for WPF Forum
9 answers
216 views
Is there a way to rotate child shapes inside of a rotating container? The idea is to keep the children of the container laid out exactly the same as the container is rotated. An additional complication is that I need to be able to select the child shapes.

This second requirement is tricky because it essentially eliminates the easy solutions -- i.e. Ellipses/Rects inside the container instead of RadDiagramShapes. 

Right now, my idea is to hook the OnRotationAngleChanged method in the RadDiagramContainer and then iterate through the children and apply a RotateTransform to the children.
 
protected override void OnRotationAngleChanged(double newValue, double oldValue)
        {
            base.OnRotationAngleChanged(newValue, oldValue);
 
            List<RadDiagramShape> childrenList = Children.OfType<RadDiagramShape>().ToList();
 
            // get rotation center
            double centerX = (ActualWidth / 2);
            double centerY = (ActualHeight / 2);
 
            foreach (RadDiagramShape item in childrenList)
            {
                RotateTransform transform = new RotateTransform(newValue, centerX, centerY);
                item.LayoutTransform = transform;
            }
        }

The idea here is that I would use the container center as the rotation origin and just have the children rotate around that point. That didn't work - in fact, it seems any values supplied as centerX/centerY produce the same behavior, which makes me think that the container might be doing some coercing of the child during layout. 

Am I making this way too hard? 



Zarko
Telerik team
 answered on 15 Nov 2013
3 answers
173 views
We have a scenario where we would like to float panels over the top of a background map. When dragged to a corner of the map we would like the panel to dock to the corner whilst remaining on top of the map. Subsequent panels would then dock (or stack) to the sides of this panel, whilst providing resize behaviour. Can this be achieved with radDocking control?
Vladi
Telerik team
 answered on 15 Nov 2013
3 answers
237 views
Hello,
when using the Office2013 theme the text in a TextBlock is smaller as that for a RadButton or a CheckBox.
Is it by design or is it a bug?
Patrick
Petya
Telerik team
 answered on 15 Nov 2013
2 answers
55 views
Hi everyone,

I am developing a WPF application in which I use RadControls including RadDocking.
How can I prevent the user to dock Panes into floating SplitContainers ?
I do not want compass indicators to be displayed over floating SplitContainers when the user is dragging a Pane.

Thank you in advance for your help
Pascal GUERY
Top achievements
Rank 1
 answered on 15 Nov 2013
1 answer
145 views
Hi,

Is there a way(or what is the best way?) to restrict the max no. of decimal places that can be entered in the RadCalcPicker?
Tried modifying the value in the ValueChanged trigger, but still all the decimal places entered are stored in memory value (dropdown).

Regards,
Phani.
Dave
Top achievements
Rank 1
 answered on 15 Nov 2013
4 answers
153 views
Hello,
i have performance problem with RadGridView. My project uses RadGridView with only 1000 items but with many columns. I tried all i can to resolve the problem without success.
Some specials, i have 2 customized columns, use normal CheckBox and normal TextBox of microsoft. I need them to implement One-Click-Edit function easily.
The problem is that,
1.) the scrollbar is very slow, even though i have only 1000 items.
2.) i always got debug error, when i scroll the GridView. The error info looks like that:
System.Windows.Data Information: 41 : BindingExpression path error: 'IsChecked' property not found for 'object' because data item is null.  This could happen because the data provider has not produced any data yet. BindingExpression:Path=IsChecked; DataItem=null; target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=IsChecked; DataItem=null; target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=IsChecked; DataItem=null; target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Information: 41 : BindingExpression path error: 'Property1' property not found for 'object' because data item is null.  This could happen because the data provider has not produced any data yet. BindingExpression:Path=Property1; DataItem=null; target element is 'TextBox' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=Property1; DataItem=null; target element is 'TextBox' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=Property1; DataItem=null; target element is 'TextBox' (Name=''); target property is 'Text' (type 'String')

I attached my project, please check, wheather i have done something wrong.
Link:
http://www.file-upload.net/download-8291326/RadGridViewPerformance.zip.html

Thanks a lot!

Ivan
Vera
Telerik team
 answered on 15 Nov 2013
6 answers
176 views
I have a WPF MVVM application that uses a ContentControl on my main window to display views(UserControls). My first view has a RadGridView and a RadDataPager in it. When I try to navigate to another view I get the error: PageIndex cannot be negative when PageSize is positive. Parameter name: newPageIndex. I have commented out the RadDataPager to verify that it is part of the issue...and it is.
I believe it has something to do with the Binding. I do NOT  set the PageIndex to -1 in the code.

I have included a LINK to a small sample project that repeats the issue. Can someone please tell me how to fix this.

<telerik:RadGridView x:Name="RgvPatients"
    HorizontalAlignment="Stretch" VerticalAlignment="Top" HorizontalContentAlignment="Center"
    AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" SelectionUnit="Cell"
    ShowGroupPanel="False" EnableRowVirtualization="False" RowIndicatorVisibility="Collapsed"
    IsFilteringAllowed="False" ItemsSource="{Binding Patients}" GridLinesVisibility="Horizontal" >
    <telerik:RadGridView.Columns>
        <telerik:GridViewColumn Header="MRN#" IsSortable="True">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Button Style="{StaticResource ButtonTransparentBlackText}" VerticalAlignment="Center" Height="25" Width="100"
                             Command="{Binding Path=SelectPatientCommand}" Content="{Binding mrn}">
                        </Button>
                    </Grid>
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>
        <telerik:GridViewDataColumn Header="Last Name"  DataMemberBinding="{Binding last_name}" IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="First Name"  DataMemberBinding="{Binding first_name}" IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="Middle Name"  DataMemberBinding="{Binding middle_name}" IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="DOB"  DataMemberBinding="{Binding dob, StringFormat='{}{0:MM/dd/yyyy}'}" IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="Age"  DataMemberBinding="{Binding dob, Converter={StaticResource AgeConverter}}"  IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="Gender"  DataMemberBinding="{Binding Gender}" IsReadOnly="True" TextAlignment="Left" />
        <telerik:GridViewDataColumn Header="Status"  DataMemberBinding="{Binding adt_type}" IsReadOnly="True" TextAlignment="Left" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
<DockPanel>
    <telerik:RadDataPager x:Name="RdpPatients" DockPanel.Dock="Left" Width="830" NumericButtonCount="5" Height="28" DisplayMode="All" 
           PageIndex="{Binding Path=PageData.PageIndex, Mode=TwoWay}"
           PageSize="20"
            
           ItemCount="{Binding Path=PageData.TotalRecords}" >
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="PageIndexChanged">
                <i:InvokeCommandAction Command="{Binding RdpPatients_PageIndexChangedCommand}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </telerik:RadDataPager>
</DockPanel>

Thanks ~Doug

Nick
Telerik team
 answered on 15 Nov 2013
3 answers
101 views
Hi,

it seems that RadDocking.DocumentHost swallows shorctcut keys defined in a AccessText. Here's an example to reproduce the problem:

xaml:
<Window x:Class="WpfTelerikDocking.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
      <Grid.RowDefinitions>
         <RowDefinition />
         <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
 
      <t:RadDocking>
         <t:RadDocking.DocumentHost>
            <StackPanel x:Name="mainPanel" />
         </t:RadDocking.DocumentHost>
      </t:RadDocking>
 
      <Button Grid.Row="1" Margin="5" Width="80" HorizontalAlignment="Left" Click="Button_Click">_Test</Button>
   </Grid>
</Window>


cs:
using System.Windows;
using System.Windows.Input;
using System.Windows.Controls;
 
namespace WpfTelerikDocking
{
   public partial class MainWindow : Window
   {
      public MainWindow()
      {
         InitializeComponent();
      }
 
      private void Button_Click(object sender, RoutedEventArgs e)
      {
         Button b = new Button();
         b.Content = new AccessText() { Text = "_XXX" };
         this.mainPanel.Children.Add(b);
      }
   }
}


When clicking on the "Test"-button another button appears  inside the DocumentHost with  the Content "XXX".  When pressing the ALT-key the shortcut of the "Test"-Button is being shown, but the shortcut on the XXXX-Button is missing.

Any ideas how to solve  this issue?

Regards,
Michael
Rosen Vladimirov
Telerik team
 answered on 15 Nov 2013
4 answers
274 views
HI there,

We are trying to style our panes and pane groups.  In this example, we're trying to change the BorderBrush to a linear gradient.

Looking at this with Snoop, I can see that the RadPaneGroup as well as a ContentControl named ContentBackground have the correct BorderBrush.  However, a Border named "Root" has a solid-color brush as its border, and this is apparently what we see.

Are there other styles we'd need to override?  If we change PaneGroup_PaneFrame_Brush in Telerik.Windows.Controls.Docking.xaml, we do see the desired change show up, but we'd like to change the border in a way that is compatible with the use of implicit styles described here:  http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html

Strangely, even copying the entire (albeit small) ControlTemplate in which PaneGroup_PaneFrame_Brush is used doesn't correctly override this behavior.

What are we doing wrong, what don't we understand, or how to we restyle the BorderBrush here?

Thanks,
-David

Example code:

<Window x:Class="WpfApplication1.MainWindow"
        Title="MainWindow">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="Telerik.Windows.Controls.Docking.xaml" />
            </ResourceDictionary.MergedDictionaries>
 
            <Thickness x:Key="PaneGroup_BorderThickness">3</Thickness>
 
            <LinearGradientBrush x:Key="PaneGroup_BorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF809EAD" Offset="0"/>
                <GradientStop Color="#FFADAFB2" Offset="1"/>
            </LinearGradientBrush>
         
            <Style BasedOn="{StaticResource RadPaneGroupStyle}" TargetType="telerik:RadPaneGroup">
                <Setter Property="BorderThickness" Value="{StaticResource PaneGroup_BorderThickness}" />
                <Setter Property="BorderBrush" Value="{StaticResource PaneGroup_BorderBrush}" />
            </Style>
 
            <LinearGradientBrush x:Key="PaneGroup_PaneFrame_Brush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF809EAD" Offset="0"/>
                <GradientStop Color="#FFADAFB2" Offset="1"/>
            </LinearGradientBrush>
 
            <ControlTemplate x:Key="PaneGroup_PaneFrameTemplate" TargetType="ContentControl">
                <Border x:Name="Root" BorderBrush="{StaticResource PaneGroup_PaneFrame_Brush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PaneGroup_PaneFrame_CornerRadius}">
                    <ContentPresenter />
                </Border>
            </ControlTemplate>
 
            <Style BasedOn="{StaticResource PaneGroup_PaneFrameStyle}" TargetType="ContentControl">
                <Setter Property="Template" Value="{StaticResource PaneGroup_PaneFrameTemplate}" />
            </Style>
 
 
        </ResourceDictionary>
    </Window.Resources>
     
    <Grid>
        <telerik:RadDocking Name="u_rd_Docking" BorderThickness="4" Grid.Row="1">
 
            <telerik:RadSplitContainer InitialPosition="DockedTop" Height="700" >
                <telerik:RadSplitContainer telerik:ProportionalStackPanel.RelativeSize="24,100" >
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="Pane 1" >
                            <Rectangle Width="50" Height="100" Fill="BlanchedAlmond" />
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
 
                <telerik:RadSplitContainer Orientation="Vertical" telerik:ProportionalStackPanel.RelativeSize="42.5,100" >
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="Pane 2" >
                            <Rectangle Width="125" Height="50" Fill="Aqua" />
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
 
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="Pane 3" >
                            <Rectangle Width="125" Height="50" Fill="Red" />
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
                 
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>



David
Top achievements
Rank 1
Iron
Iron
 answered on 14 Nov 2013
1 answer
166 views
Hi!

I'm using Telerik controls for WPF version Q1 2013 (have not been able to get latest licensed version yet... hopefully we get that soon).

I have a problem with setting TileView's RowsCount and ColumnsCount to certain value and then resizing the window. Looks like tiles are cropped from their right side if window width gets smaller and from bottom if window height gets smaller. Is there a way to prevent this?

Here's a screenshot with TileView's column count set to 4. I only have one tile in this example and tile's right side is cropped long before window size reaches the tile... And If I set column count to 6 the tile is cropped even sooner.

Column count 4 example #1

Column count 4 example #2

It is ok for the tile to be cropped like this but only if the width of the window reaches the tile. I hope you understand what I mean by this.

Br,

Kalle
Zarko
Telerik team
 answered on 14 Nov 2013
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?