Telerik Forums
UI for WPF Forum
2 answers
161 views
Hi,

We are encountering the following issues with the positioning of Key Tips when using multiple monitors:
  1. If the window is currently spanning monitors when the tips are shown they will be displayed offset on the first monitor.
        This is due to the use of popup (which automatically is shifted by WPF framework to fit on a monitor)
  2. If the window (RadRibbonWindow) is maximized on the second monitor, key tips will be shown on the first monitor.
        What is happening here is that the secondary monitor is 1280px wide.  When the window is maximised its RenderSize (and ActualWidth) is being reported as 1296 (Ribbon Width is correctly 1280).  This leads to a Popup with width 1296 which is automatically shifted onto the first (wider) monitor by the Popup infrastructure.

Note that if I change the RadRibbonWindow to be a standard WPF Window this second behaviour does not occur.

I realise that any changes to this are pretty difficult - have you got any suggested workarounds?

Regards,

Mark
Mark
Top achievements
Rank 1
 answered on 21 Jun 2012
1 answer
106 views
I have a RadGRidView on a screen that is set for SelectionMode Expanded.  Once the user has selected all that they want from the fird they will push a button to update all of those records.  How do I itterate through the selected rows and get the Data from one Cell per row.
Eric Klein
Top achievements
Rank 1
 answered on 21 Jun 2012
4 answers
465 views
Hello,

I am on my way to trying to solve my issues that I posted here
One problem that I have noticed so far is that it seems that I can not have both ItemTemplateSelector and ItemContainerStyle for a TreeView.  Is this a bug?  If not, how would I go about using a custom TreeViewItemStyle?

Thanks
Ryan

 <Window.Resources> 
        <!-- List Item Selected --> 
        <LinearGradientBrush x:Key="GotFocusStyle"  EndPoint="0.5,1" StartPoint="0.5,0"
            <LinearGradientBrush.GradientStops> 
                <GradientStop Color="Black" Offset="0.501"/> 
                <GradientStop Color="#FF091F34"/> 
                <GradientStop Color="#FF002F5C" Offset="0.5"/> 
            </LinearGradientBrush.GradientStops> 
        </LinearGradientBrush> 
 
        <!-- List Item Hover --> 
        <LinearGradientBrush x:Key="MouseOverFocusStyle" StartPoint="0,0" EndPoint="0,1"
            <LinearGradientBrush.GradientStops> 
                <GradientStop Color="#FF013B73" Offset="0.501"/> 
                <GradientStop Color="#FF091F34"/> 
                <GradientStop Color="#FF014A8F" Offset="0.5"/> 
                <GradientStop Color="#FF003363" Offset="1"/> 
            </LinearGradientBrush.GradientStops> 
        </LinearGradientBrush> 
 
        <!-- List Item UnSelected --> 
        <LinearGradientBrush x:Key="LostFocusStyle" EndPoint="0.5,1" StartPoint="0.5,0"
            <LinearGradientBrush.RelativeTransform> 
                <TransformGroup> 
                    <ScaleTransform CenterX="0.5" CenterY="0.5"/> 
                    <SkewTransform CenterX="0.5" CenterY="0.5"/> 
                    <RotateTransform CenterX="0.5" CenterY="0.5"/> 
                    <TranslateTransform/> 
                </TransformGroup> 
            </LinearGradientBrush.RelativeTransform> 
            <GradientStop Color="#FF091F34" Offset="1"/> 
            <GradientStop Color="#FF002F5C" Offset="0.4"/> 
        </LinearGradientBrush> 
 
        <!-- List Item Highlight --> 
        <SolidColorBrush x:Key="ListItemHighlight" Color="#FFE38E27" /> 
 
        <!-- List Item UnHighlight --> 
        <SolidColorBrush x:Key="ListItemUnHighlight" Color="#FF6FB8FD" /> 
 
        <!-- Button Gradient --> 
        <LinearGradientBrush x:Key="ButtonGradient" EndPoint="0.5,1" StartPoint="0.5,0"
            <GradientStop Color="#FF0E3D70"/> 
            <GradientStop Color="#FF001832" Offset="1"/> 
        </LinearGradientBrush> 
    </Window.Resources> 
         
    <Grid> 
        <Grid.Resources> 
 
            <ControlTemplate TargetType="Telerik:RadTreeViewItem" x:Key="TreeViewItemDefaultTemplate"
                <ControlTemplate.Triggers> 
                    <Trigger Property="IsSelected" Value="True"
 
                    </Trigger> 
                    <Trigger Property="IsSelected" Value="True"
                        <Trigger.EnterActions> 
                            <BeginStoryboard> 
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="SelectionVisual" 
                                            Storyboard.TargetProperty="Visibility" Duration="0"
                                        <DiscreteObjectKeyFrame KeyTime="0"
                                            <DiscreteObjectKeyFrame.Value> 
                                                <Visibility>Visible</Visibility> 
                                            </DiscreteObjectKeyFrame.Value> 
                                        </DiscreteObjectKeyFrame> 
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard> 
                            </BeginStoryboard> 
                        </Trigger.EnterActions> 
                    </Trigger> 
                    <Trigger Property="IsFocused" Value="True"
                        <Trigger.EnterActions> 
                            <BeginStoryboard> 
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="FocusVisual" 
                                            Storyboard.TargetProperty="Visibility" Duration="0"
                                        <DiscreteObjectKeyFrame KeyTime="0"
                                            <DiscreteObjectKeyFrame.Value> 
                                                <Visibility>Visible</Visibility> 
                                            </DiscreteObjectKeyFrame.Value> 
                                        </DiscreteObjectKeyFrame> 
                                    </ObjectAnimationUsingKeyFrames> 
                                </Storyboard> 
                            </BeginStoryboard> 
                        </Trigger.EnterActions> 
                    </Trigger> 
                    <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 Margin="2" Height="Auto" VerticalAlignment="Top"
 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="Auto" /> 
                        <RowDefinition Height="Auto" /> 
                    </Grid.RowDefinitions> 
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="Auto" /> 
                        <ColumnDefinition Width="Auto" /> 
                    </Grid.ColumnDefinitions> 
                    <Grid Grid.Row="0" Grid.Column="0" x:Name="HeaderRow" Height="Auto" VerticalAlignment="Bottom"
                        <!-- Selection --> 
                        <Border x:Name="SelectionVisual" Visibility="Collapsed" 
                                BorderBrush="#FFA8C9D8" BorderThickness="1,1,1,1" 
                                CornerRadius="3,3,3,3"
                            <Border.Background> 
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                    <GradientStop Color="#FF00CCFF" Offset="0" /> 
                                    <GradientStop Color="#FF9BB1FF" Offset="1" /> 
                                </LinearGradientBrush> 
                            </Border.Background> 
                            <Border CornerRadius="2,2,2,2" BorderBrush="#FFFFFFFF" 
                                    BorderThickness="2"
                                <Border.Background> 
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                        <GradientStop Color="#E5FFFFFF" Offset="0" /> 
                                        <GradientStop Color="#33FFFFFF" Offset="1" /> 
                                        <GradientStop Color="#4DFFFFFF" Offset="0.5" /> 
                                        <GradientStop Color="#00FFFFFF" Offset="0.511" /> 
                                    </LinearGradientBrush> 
                                </Border.Background> 
 
                            </Border> 
                        </Border> 
                        <StackPanel> 
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                                <ContentControl Name="Header" 
                                        Content="{TemplateBinding Header}" 
                                        ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                        HorizontalAlignment="Center" VerticalAlignment="Center" /> 
                            </StackPanel> 
                            <ToggleButton x:Name="Expander" Margin="0,0,0,5"></ToggleButton> 
                        </StackPanel> 
 
                        <Rectangle x:Name="FocusVisual" RadiusX="3" RadiusY="3" 
                                Visibility="Collapsed" Stroke="Black" StrokeThickness="0.75" 
                                StrokeDashArray="1,2" IsHitTestVisible="False" /> 
                    </Grid> 
                    <ItemsPresenter Grid.Row="1" x:Name="ItemsHost" Visibility="Collapsed" /> 
                </Grid> 
 
            </ControlTemplate> 
 
            <Style TargetType="Telerik:RadTreeViewItem" x:Key="TreeViewItemStyle"
                <Setter Property="Template" Value="{StaticResource TreeViewItemDefaultTemplate}" /> 
            </Style> 
 
            <Style TargetType="ToggleButton" x:Key="Expander"
                <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> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
 
            <XmlDataProvider x:Key="MyList" Source="XML/Scenes.xml" /> 
 
            <HierarchicalDataTemplate x:Key="Procedures" ItemsSource="{Binding XPath=Procedures/Procedure}"
                <Grid> 
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="300" /> 
                    </Grid.ColumnDefinitions> 
                    <Label  
                        VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="Transparent" 
                        Foreground="Aqua" 
                        FontSize="18" 
                        Tag="{Binding XPath=@name}" 
                        MinHeight="55" 
                        Cursor="Hand" 
                        FontFamily="Arial" 
                        FocusVisualStyle="{x:Null}" 
                        KeyboardNavigation.TabNavigation="None" 
                        Background="{StaticResource LostFocusStyle}" 
                        Name="SubItem" 
                    > 
                        <Label.ContextMenu> 
                            <ContextMenu Name="editMenu"
                                <MenuItem Header="Edit"/> 
                            </ContextMenu> 
                        </Label.ContextMenu> 
                        <TextBlock Text="{Binding XPath=@name}" Margin="15,0,40,0" TextWrapping="Wrap"></TextBlock> 
                    </Label> 
                </Grid> 
            </HierarchicalDataTemplate> 
 
            <HierarchicalDataTemplate x:Key="Scenes" ItemsSource="{Binding XPath=Procedures/Procedure}"
                <Grid> 
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="300" /> 
                    </Grid.ColumnDefinitions> 
                    <Label  
                        VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="Transparent" 
                        Foreground="White" 
                        FontSize="18" 
                        Tag="{Binding XPath=@name}" 
                        MinHeight="55" 
                        Cursor="Hand" 
                        FontFamily="Arial" 
                        FocusVisualStyle="{x:Null}" 
                        KeyboardNavigation.TabNavigation="None" 
                        Background="{StaticResource LostFocusStyle}" 
                        Name="SubItem" 
                    > 
                        <Label.ContextMenu> 
                            <ContextMenu Name="editMenu"
                                <MenuItem Header="Edit"/> 
                            </ContextMenu> 
                        </Label.ContextMenu> 
                        <TextBlock Text="{Binding XPath=@name}" Margin="15,0,40,0" TextWrapping="Wrap"></TextBlock> 
                    </Label> 
                </Grid> 
            </HierarchicalDataTemplate> 
 
            <local:LeagueDataTemplateSelector x:Key="SceneSelector" ScenesTemplate="{StaticResource Scenes}" ProceduresTemplate="{StaticResource Procedures}" /> 
         
        </Grid.Resources> 
        <Grid Width="300" Height="320" HorizontalAlignment="Center" VerticalAlignment="Center"
            <Border BorderBrush="#FF000000" CornerRadius="5" BorderThickness="5" Background="#FFFFFFFF"
 
                <Telerik:RadTreeView 
                    ExpanderStyle="{StaticResource Expander}"  
                    ItemsSource="{Binding Source={StaticResource MyList}, XPath=/Scenes/Scene}" 
                    ItemTemplateSelector="{StaticResource SceneSelector}" 
                    ItemContainerStyle="{StaticResource TreeViewItemStyle}" 
                /> 
            </Border> 
        </Grid> 
    </Grid> 

Code Behind
public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
 
        } 
    } 
 
    public class LeagueDataTemplateSelector : DataTemplateSelector 
    { 
        private HierarchicalDataTemplate scenes; 
        private HierarchicalDataTemplate procedures; 
  
        public LeagueDataTemplateSelector() 
        { 
        } 
 
        public HierarchicalDataTemplate ScenesTemplate 
        { 
           get 
           { 
               return this.scenes; 
           } 
           set 
           { 
               this.scenes = value
           } 
        } 
 
        public HierarchicalDataTemplate ProceduresTemplate 
        { 
           get 
           { 
               return this.procedures; 
           } 
           set 
           { 
               this.procedures = value
           } 
        } 
 
        public override DataTemplate SelectTemplate(object item, DependencyObject container) 
        { 
            string itemName = ((System.Xml.XmlElement)item).Name; 
 
            if (itemName == "Procedure") 
            { 
                return this.procedures; 
            } 
            else if (itemName == "Scene") 
            { 
                return this.scenes; 
            } 
            return null; 
        } 
    } 

Tina
Top achievements
Rank 1
 answered on 21 Jun 2012
11 answers
205 views

Hi,

I am using a rowstyleselector, but the griditem gets only selected when one of the controls inside the style template is clicked.
Clicking in an empty area between the controls in the template does NOT result in the item being selected (tested by subscribing to the SelectionChanged event) Using a single column with a cellstyleselector is not an option for me, since it does not correctly stretches its content according to the radgridview-width. Any ideas on this? (We are using the latest version 2012 Q1)

Bart Reekmans
Top achievements
Rank 1
 answered on 21 Jun 2012
4 answers
870 views
I'm getting error: "The type or namespace name 'External' does not exist in the namespace 'Telerik.Windows.Controls'(are you missing an assembly reference?)"

This error is in my MainWindow.g.cs file. It occurred when I added "Telerik.Windows.Controls.ScheduleView.xaml" (OfficeBlue) to my project. Whenever I get this error I can "clean solution" and run and it works. But if I make a change to anything in my project and try to run it, it errors. I tried finding this class reference in the ScheduleView documentation and no luck. If I delete the "using Telerik.Windows.Controls.External;" out of my code I get a bunch of errors. So I assume there has to be some reference that the project is finding.

Any help would be much appreciated.

(This is using the trial version with Blend 4, Windows 7 service pack 1).
Geoff
Top achievements
Rank 1
 answered on 21 Jun 2012
2 answers
174 views
Maybe this is obvious but I can't seem to figure it out.
I have a RadGridView that's displaying paged data (with a RadDataPager).
Let's say the page size is N.
When there are less than N items in the data source, the grid sizes itself exactly to the number of rows.
When there are exactly or more than N items in the data source, the grid sizes itself exactly to N rows (and it will never be any bigger, of course).
Is it possible to "lock" the grid's desired height to the PageSize (so that it doesn't change size regardless of the number of items being displayed, and it's always exactly big enough to show N items, with empty space only if the number of items is less than N).
The grid's containing element will size itself dynamically according to the grid's preferred size. 
I don't want to hard-code the Height, for obvious reasons.
Wayne
Top achievements
Rank 1
 answered on 21 Jun 2012
3 answers
183 views
Hi,

in my RadWindow I have a RadComboBox, when I show my RadWindow, I already have an object and I set the Text property of my RadComboBox but at the same time, I have a running BackgroundWorker who get the ItemSource data of my RadComboBox. The BackgroundWorker take about 3 or 4 seconds to get all the data for the RadComboBox.

When my BackgroundWorker is completed, I set the ItemsSource of my RadComboBox but the Text property of my RadComboBox are not synchronize with their ItemSource. If I click on the dropdown button of my RadComboBox, the corresponding value in the dropdown are highlight.

How I can fix tthis?

Thank's
Konstantina
Telerik team
 answered on 21 Jun 2012
3 answers
344 views
Hi, I have two question I can't find in the forum:

1-. I have a RadGridView binded to datasource, once the data is binded (or binding), how can i tell RadGridView wich columns are visibles and which aren't. (AutogenerateCoumns=true)

2-. Is there a way to bind columnheaders?

We are using MVVM pattern

Thanks
Dimitrina
Telerik team
 answered on 21 Jun 2012
3 answers
245 views
Is the engine being used to evaluate text expressions built into the RadExpressionEditor, or is it a separate assembly? I would like to use the RadExpressionEditor to build expressions within a WPF environment, but then I need to be able to take that expression text and rebuild the expression in an environment that does not have references to the WPF related assemblies.

Thanks,
Brian
Dimitrina
Telerik team
 answered on 21 Jun 2012
4 answers
131 views
the contextmenu hind behind the RadPane when performing a right click, does anybody know how to fix this?
James
Top achievements
Rank 1
 answered on 21 Jun 2012
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?