Telerik Forums
UI for WPF Forum
1 answer
126 views
Hello

I'd like to know whether it is possible to store the current
caret position of a RadDocument into the XAML string
persisted by the XamlFormatProvider?

We sometimes insert textfragments into a XAML copy of a RAD document
at runtime.
Then replace the whole RRTB document by the modified copy.
After the replacement  the caret position is lost -
of course.
If the info would get stored into the persisted XAML, it'll be fine.
Is there a way to achieve it and store the caret position into XAML?

Thx,
Chris
Iva Toteva
Telerik team
 answered on 22 Jun 2012
0 answers
103 views
Hi,

I need the current row's index in rowLoaded event of Rad Grid, Is not there any equivalent for e.rowIndex in this event?

Thanks
Anjali
Top achievements
Rank 1
 asked on 22 Jun 2012
2 answers
140 views
I have set the auto generate columns to true,I need to modify the format of some columns at run time.Which Grid event should I use for this?
Thanks,
Anjali
Anjali
Top achievements
Rank 1
 answered on 22 Jun 2012
1 answer
67 views
Hi

I am facing an issue where if i copy and paste in RadMaskedCurrencyInput(WPF) the value doesn't get reflected. I am using the DLL version 2011.1.419.35

Please note, I have set the property SelectionOnFocus="SelectAll". So what happened when i try copying any number in the textbox then the value is not visible when the focus is out of textbox but when the focus comes within the textbox then entire text get selected and the copied text gets visible.

Please suggest.

Thanks
Ambuj




Petar Mladenov
Telerik team
 answered on 22 Jun 2012
0 answers
64 views
Hi. I wonder how can I create a shadow similar to the one found in wpf demo? I've attached a screenshot. 
I searched but couldn't find source code of WPF demo app. Any help would be greatly appreciated.

Thanks
David
Top achievements
Rank 1
 asked on 22 Jun 2012
2 answers
168 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
139 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
480 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
222 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
883 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
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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?