Telerik Forums
UI for WPF Forum
4 answers
319 views

(I am using Telerik 2013.2.809.40 for WPF)

I have a RadCartesianChart with a Series that contains 30 items (categories are from “2013” to “2032”).


I want to show only the labels “2015”, “2020”,“2025”,“2030” in my CategoricalAxis.

How can I do this?
Setting LabelInterval=5 and LabelOffset=2
does not work (in this case only "2023" and "2028 are shown)

Thanks - Janko

Martin Ivanov
Telerik team
 answered on 03 Feb 2014
4 answers
342 views
Hello,

I am using a Spline defenition and when I double click the window header to fit the window to the Monitor I get an out of memory error. It looks like it is trying to Redraw the Spline lines. Here is the Stack Trace:

   at MS.Utility.ArrayItemList`1.Add(T value)
   at MS.Utility.FrugalStructList`1.Add(T value)
   at System.Windows.Media.PointCollection.AddWithoutFiringPublicEvents(Point value)
   at System.Windows.Media.PointCollection.Add(Point value)
   at Telerik.Windows.Controls.Charting.SplineHelper.GenerateSplineSegmentPoints(Point pt0, Point pt1, Point pt2, Point pt3, Double tolerance)
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.CalculateSplinePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
   at Telerik.Windows.Controls.Charting.SplineSeries.CalculatePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeTopBorderLineGeometry()
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeSeriesGeometry()
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.SeriesSizeChanged(Object sender, SizeChangedEventArgs e)
   at System.Windows.SizeChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.FrameworkElement.OnRenderSizeChanged(SizeChangedInfo sizeInfo)
   at System.Windows.ContextLayoutManager.fireSizeChangedEvents()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at K2Analytics.Application.Main() in C:\Projects\ConsumerInsights\K2Analytics_Soln\K2Analytics\obj\Debug\Application.g.vb:line 69
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
   at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
   at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
   at System.Activator.CreateInstance(ActivationContext activationContext)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Thanks,
Matt
Martin Ivanov
Telerik team
 answered on 03 Feb 2014
1 answer
114 views
Hello,
I've upgraded an old wpf application to latest Telerik WPF control version... before I've defined a GridViewCommandRow that will substitute the grouping header to the 2 buttons export/print

the code is taken from a your article and it's

public class GridViewCommandRow
   {
       public static readonly DependencyProperty IsEnabledProperty =
           DependencyProperty.RegisterAttached("IsEnabled",
                                               typeof (bool),
                                               typeof (GridViewCommandRow),
                                               new PropertyMetadata(false, OnIsEnabledChanged));
 
       public GridViewCommandRow(RadGridView grid)
       {
           RadGridView = grid;
           CommandRow = new ContentControl();
           CommandRow.SetValue(Grid.RowProperty, 0);
 
           if (ViewCommandTemplate == null)
           {
               var commandRowTemplate = Generic.GetInstance()["CommandRowTemplate"] as ControlTemplate;
 
               if (commandRowTemplate != null)
                   ViewCommandTemplate = commandRowTemplate;
           }
       }
 
       public ControlTemplate ViewCommandTemplate { get; set; }
 
       private ContentControl CommandRow { get; set; }
 
       public RadGridView RadGridView { get; private set; }
 
       public static void SetIsEnabled(DependencyObject dependencyObject, bool enabled)
       {
           dependencyObject.SetValue(IsEnabledProperty, enabled);
       }
 
       public static object GetIsEnabled(DependencyObject dependencyObject)
       {
           return dependencyObject.GetValue(IsEnabledProperty);
       }
 
       private static void OnIsEnabledChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
       {
           var radGridView = sender as RadGridView;
           if (radGridView != null)
           {
               if ((bool) e.NewValue)
               {
                   // Create new GridViewCommandRow and attach RadGridView events.
                   var commandRow = new GridViewCommandRow(radGridView);
 
                   commandRow.Attach();
               }
           }
       }
 
       private void Attach()
       {
           RadGridView.DataLoaded += RadGridView_DataLoaded;
       }
 
       private void RadGridView_DataLoaded(object sender, EventArgs e)
       {
           if (RadGridView.Items.Count > 0)
           {
               RadGridView.SelectedItem = RadGridView.Items[0];
           }
 
 
           Grid hierarchyGrid =
               RadGridView.ChildrenOfType<Grid>().FirstOrDefault(c => c.Name == "HierrarchyBackground");
 
           if (hierarchyGrid != null && CommandRow.Parent == null)
           {
               hierarchyGrid.Children.Add(CommandRow);
 
               CommandRow.Template = ViewCommandTemplate;
           }
       }
   }

The template is defined here

<ResourceDictionary x:Class="DOME.Modules.Core.Themes.Generic"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                  
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:conv="clr-namespace:DOME.Modules.Core.Framework.Converters"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
                    xmlns:if="clr-namespace:DOME.Modules.Core" xmlns:local="clr-namespace:DOME.Modules.Core">
 
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary>
             
            <SolidColorBrush x:Key="GridView_EditIndicatorBackground1" Color="#7F848484" />
            <SolidColorBrush x:Key="GridView_EditIndicatorBackground2" Color="#FFCBCBCB" />
            <SolidColorBrush x:Key="GridView_EditIndicatorBackground3" Color="#FF848484" />
            <SolidColorBrush x:Key="GridView_EditIndicatorBackground4" Color="#FFB6F7FD" />
            <LinearGradientBrush x:Key="GridViewGroupPanelInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFEAEDF6" Offset="0" />
                <GradientStop Color="#FFF2F5FA" Offset="1" />
            </LinearGradientBrush>
            <telerik:Office_BlackTheme x:Key="Theme" />
            <SolidColorBrush x:Key="ControlOuterBorder_Normal" Color="#FF848484" />
            <LinearGradientBrush x:Key="ControlBackground_Normal" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White" />
                <GradientStop Color="#FFD4D4D4" Offset="1" />
                <GradientStop Color="Gainsboro" Offset="0.42" />
                <GradientStop Color="#FFADADAD" Offset="0.43" />
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ControlForeground_Normal" Color="#FF0E0E0E" />
            <CornerRadius x:Key="ControlOuterBorder_CornerRadius">1</CornerRadius>
            <LinearGradientBrush x:Key="InsertBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White" />
                <GradientStop Color="#FFA9E0AF" Offset="1" />
                <GradientStop Color="#FFA9F7B0" Offset="0.42" />
                <GradientStop Color="#FF6D8F70" Offset="0.43" />
            </LinearGradientBrush>
             
            <Style x:Key="RadButtonStyle1" TargetType="telerik:RadButton">
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}" />
                <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}" />
                <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}" />
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
                <Setter Property="Padding" Value="3" />
                <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerik:RadButton">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" Storyboard.TargetName="Content"
                                         Storyboard.TargetProperty="Opacity" To="0.5" />
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="buttonChrome"
                                                               BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
                                                               telerik:StyleManager.Theme="{StaticResource Theme}" CornerRadius="{TemplateBinding CornerRadius}"
                                                               RenderEnabled="{TemplateBinding IsEnabled}" RenderFocused="{TemplateBinding IsFocused}"
                                                               RenderMouseOver="{TemplateBinding IsMouseOver}" RenderNormal="{TemplateBinding IsBackgroundVisible}"
                                                               RenderPressed="{TemplateBinding IsPressed}" Background="{StaticResource ControlBackground_Normal}" />
                                <ContentPresenter x:Name="Content"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" OpacityMask="{StaticResource InsertBackground}"
                                  Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="FontSize" Value="13.333" />
            </Style>
 
            <BooleanToVisibilityConverter x:Key="visibilityConverter"></BooleanToVisibilityConverter>
 
            <Style x:Key="FlowDocStyle" TargetType="{x:Type FlowDocumentScrollViewer}">
                <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type FlowDocumentScrollViewer}">
                            <Grid Language="en-us" Uid="Grid_26">
                                <Grid.Resources>
                                    <conv:HtmlToFlowDocumentConverter x:Key="htmlToXamlConverter" />
                                </Grid.Resources>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Border CornerRadius="10" Uid="Border_49" Margin="0,0,0,0" Background="Azure">
                                    <ScrollViewer x:Name="PART_ContentHost"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Uid="ScrollViewer_8"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="#FFEFF7FC" Margin="5,5,5,5" Height="Auto"
                                Width="Auto">
                                    </ScrollViewer>
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
 
            <ControlTemplate x:Key="test" TargetType="{x:Type if:IFUserControl}">
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
                    <Grid>
                        <Grid.Resources>
                            <conv:HtmlToFlowDocumentConverter x:Key="htmlToXamlConverter" />
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="16"></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" HorizontalAlignment="Right" Orientation="Horizontal">
                            <Image Height="16" Width="16" x:Name="image">
                                <Image.Source>
                                    <BitmapImage UriSource="/DOME;component/Media/help.png"></BitmapImage>
                                </Image.Source>
                            </Image>
                            <Popup IsOpen="False" x:Name="HelpMessagePopUp" AllowsTransparency="True"
                     PopupAnimation="Fade" HorizontalOffset="-35" VerticalOffset="0">
                                <Grid>
                                    <Border BorderThickness="1" BorderBrush="Black" CornerRadius="10">
                                        <FlowDocumentScrollViewer x:Name="flowdoc"
                                              Document="{Binding HelpMessage,Converter={StaticResource htmlToXamlConverter}}" Style="{StaticResource FlowDocStyle}">
                                        </FlowDocumentScrollViewer>
                                    </Border>
                                </Grid>
                            </Popup>
                        </StackPanel>
                        <ContentPresenter Grid.Row="1" ContentTemplate="{TemplateBinding ContentTemplate}"
                              Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True" SourceName="image">
                        <Setter TargetName="HelpMessagePopUp" Property="IsOpen" Value="True" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
 
            <ControlTemplate x:Key="CommandRowTemplate">
                <StackPanel Orientation="Horizontal" Background="{StaticResource GridViewGroupPanelInnerBorderBrush}">
                    <telerik:RadButton Command="{Binding PrintExportModel.PrintCommand}"
                             CommandParameter="{Binding RelativeSource= { RelativeSource AncestorType={x:Type telerik:RadGridView}}}" Width="40"
                             Height="35" Margin="5" Style="{StaticResource RadButtonStyle1}" IsEnabled="{Binding CanPrintExport}">
                        <telerik:RadButton.Content>
                            <StackPanel Orientation="Horizontal">
                                <Image Height="20" Width="20">
                                    <Image.Source>
                                        <BitmapImage UriSource="/DOME;component/Media/print.png"></BitmapImage>
                                    </Image.Source>
                                </Image>
                            </StackPanel>
                        </telerik:RadButton.Content>
                    </telerik:RadButton>
                    <telerik:RadButton Command="{Binding PrintExportModel.ExportCommand}"
                             CommandParameter="{Binding RelativeSource= { RelativeSource AncestorType={x:Type telerik:RadGridView}}}" Width="40"
                             Height="35" Margin="5" Style="{StaticResource RadButtonStyle1}" IsEnabled="{Binding CanPrintExport}">
                        <telerik:RadButton.Content>
                            <StackPanel Orientation="Horizontal">
                                <Image Height="20" Width="20">
                                    <Image.Source>
                                        <BitmapImage UriSource="/DOME;component/Media/export.png"></BitmapImage>
                                    </Image.Source>
                                </Image>
                            </StackPanel>
                        </telerik:RadButton.Content>
                    </telerik:RadButton>
 
                    <telerik:RadButton Command="{Binding PrintExportModel.ExportMasterDetailCommand}"
                             CommandParameter="{Binding RelativeSource= { RelativeSource AncestorType={x:Type telerik:RadGridView}}}" Width="40"
                             Height="35" Margin="5" Style="{StaticResource RadButtonStyle1}" IsEnabled="{Binding CanExportMasterDetail}"
                             Visibility="{Binding CanExportMasterDetail,Converter={StaticResource visibilityConverter}}">
                        <telerik:RadButton.Content>
                            <StackPanel Orientation="Horizontal">
                                <Image Height="20" Width="20">
                                    <Image.Source>
                                        <BitmapImage UriSource="/DOME;component/Media/export.png"></BitmapImage>
                                    </Image.Source>
                                </Image>
                            </StackPanel>
                        </telerik:RadButton.Content>
                    </telerik:RadButton>
                </StackPanel>
            </ControlTemplate>
 
            <x:Array Type="{x:Type telerik:RadMenuItem}" x:Key="ContextMenuCommandTemplate">
                <telerik:RadMenuItem Header="Expand all" CommandParameter="expand_all" />
                <!-- x:Name="expand"-->
                <telerik:RadMenuItem Header="Collapse all" CommandParameter="collapse_all" />
                <!--x:Name="collapse" -->
            </x:Array>
        </ResourceDictionary>
        <ResourceDictionary Source="MyDictionary.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

The buttons don't appear anymore...how can I fix it
Dimitrina
Telerik team
 answered on 03 Feb 2014
1 answer
134 views
Hello!

I'm trying to implement map control and I use VisualizationLayer, but I have some issues with that...

1. I would like to filter some items which I want to display on the map but when I try to use ListCollectionView I get error "'System.Windows.Data.ListCollectionView' is not a valid value for property 'Source'.". Do you have any ideas why is this happening?
ListCollectionView for InformationLayer works great.

2. In my solution I had to use custom class which implements IMapPropertyAccessor interface but the problem is when I want to update "Location" on the fly, I don't know how to propagate this change to the user interface.
Do you have any suggestion how to do this?
Andrey
Telerik team
 answered on 03 Feb 2014
1 answer
109 views
Hello!

I have added some TileViewItems to my TileView using RegionManager.AddToRegion() and it's working fine (I think RequestNavigate would do the trick also).

Now I would like to allow user to configure each tile separately. One configuration option would require me to change the configured tile to show another view (and maybe use its own viewmodel also).

Is this possible?

Now that I try RequestNavigate to this TileView region it always adds a new TileItem and that is not what I want in this case. I'd like to be able to only change the view/viewmodel for the tile I'm configuring.

Br,

Kalle
Pavel R. Pavlov
Telerik team
 answered on 03 Feb 2014
0 answers
138 views
Hi,
Can You please tell me why this code is not working. In code behind:
private void Button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
             
            ofd.Filter = "Pdf-Dateien (*.pdf)|*.pdf";
 
            if (ofd.ShowDialog() == true)
            {
 
                this.documentStream = new FileStream(ofd.FileName, FileMode.Open);
                RadFixedDocument doc = new PdfFormatProvider(this.documentStream, FormatProviderSettings.ReadOnDemand).Import();
 
                this.pdfViewer.Document = doc;
 
            }
        }
and in XAML:
<telerik:RadPdfViewer Grid.Row="1" x:Name="pdfViewer" Grid.ColumnSpan="2"/>
System report no errors, simply nothing is showing in viewer.

Best Regards
Nebojsa Danilovic
Nebojsa
Top achievements
Rank 1
 asked on 03 Feb 2014
2 answers
308 views
Hi,

I thought (from the first look it seems so) AutoCompleteBox is what I'm looking for.
Searching the help I found not a single word how to bind Text with this control.

Further investigations brought me to a mix of "SearchText" and "SelectedItems" - which barely works

Anyhow - what I expected was:
a.) A TextBox (with validation and binding for the text)
b.) Suggestions with the possibility to choose (and also change) an item

Or (except for Validation) - the thing you see in Internet Explorer.

Can I do this with RadAutoCompleteBox?

Approach:
User has give a "Reason" for something.
In my Model I have Item.Reason - which must be filled.
Since the resons are often the same - I have a list of default reasons - as suggestions whild entering text.
The user chan choose an existing one - his own one - at the end there is text in the box - which has to be validated (IDataErrorInfo)
If it fails  - red markers.....

Manfred
ManniAT
Top achievements
Rank 2
 answered on 03 Feb 2014
1 answer
70 views
Hi,

I am trying to migrate a project from RadControls for WPF Q1 2011 SP1 version to UI for WPF Q3 2013.

The project was working before changing Telerik dll, now I get this message error :

Error    1    Unknown build error, 'Derived method 'OnItemsCollectionChanged' in type 'Telerik.Windows.Controls.GridView.BaseItemsControl' from assembly 'Telerik.Windows.Controls.GridView, Version=2013.3.1316.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' cannot reduce access. Line 1047 Position 51.'   

The line 1047 is the first line of this part of code :

<Style TargetType="{x:Type telerik:RadGridView}">
  <Setter Property="HeaderRowStyle" Value="{DynamicResource MyGridViewHeaderRow}"/>  <Setter Property="Template">
   <Setter.Value>
    <ControlTemplate TargetType="{x:Type telerik:RadGridView}">
     <AdornerDecorator>
      <Border x:Name="PART_MasterGridContainer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
       <Grid x:Name="HierrarchyBackground" Background="{TemplateBinding Background}">
        <Grid.ColumnDefinitions>
         <ColumnDefinition Width="0.032*"/>
         <ColumnDefinition Width="0.968*"/>
         <ColumnDefinition x:Name="ScrollBarColumn" MinWidth="0" Width="0"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition x:Name="PART_AttachedBehaviorRow" Height="Auto"/>
         <RowDefinition/>
         <RowDefinition x:Name="ScrollBarRow" Height="0" MinHeight="0"/>
         <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <telerik:GridViewGroupPanel x:Name="PART_GroupPanel" BorderBrush="#FF848484" Grid.ColumnSpan="2" Foreground="{TemplateBinding GroupPanelForeground}" IsTabStop="False" Grid.Row="0" d:LayoutOverrides="GridBox">
         <telerik:GridViewGroupPanel.Background>
          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
           <GradientStop Color="#FFDFDFDF" Offset="1"/>
           <GradientStop Color="{DynamicResource ColorTresClair}"/>
          </LinearGradientBrush>
         </telerik:GridViewGroupPanel.Background>
         <telerik:StyleManager.Theme>
          <telerik:Office_BlackTheme/>
         </telerik:StyleManager.Theme>
        </telerik:GridViewGroupPanel>
        <telerik:GridViewScrollViewer x:Name="PART_ItemsScrollViewer" Background="Transparent" CanContentScroll="True" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="1">         <telerik:GridViewScrollViewer.FooterRow>
          <telerik:GridViewFooterRow x:Name="PART_FooterRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}">
           <telerik:StyleManager.Theme>
            <telerik:Office_BlackTheme/>
           </telerik:StyleManager.Theme>
          </telerik:GridViewFooterRow>
         </telerik:GridViewScrollViewer.FooterRow>
         <telerik:GridViewScrollViewer.HeaderRow>
          <telerik:GridViewHeaderRow x:Name="PART_HeaderRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}">
           <telerik:StyleManager.Theme>
            <telerik:Office_BlackTheme/>
           </telerik:StyleManager.Theme>
          </telerik:GridViewHeaderRow>
         </telerik:GridViewScrollViewer.HeaderRow>
         <telerik:GridViewScrollViewer.NewRow>
          <telerik:GridViewNewRow x:Name="PART_AddNewRow" IsTabStop="False" IndentLevel="{TemplateBinding GroupCount}" Visibility="Collapsed">
           <telerik:StyleManager.Theme>
            <telerik:Office_BlackTheme/>
           </telerik:StyleManager.Theme>
          </telerik:GridViewNewRow>
         </telerik:GridViewScrollViewer.NewRow>
         <telerik:StyleManager.Theme>
          <telerik:Office_BlackTheme/>
         </telerik:StyleManager.Theme>
         <telerik:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>
        </telerik:GridViewScrollViewer>
        <telerik:ScrollPositionIndicator x:Name="PART_ScrollPositionIndicator" Grid.ColumnSpan="1" ContentTemplate="{TemplateBinding ScrollPositionIndicatorTemplate}" HorizontalAlignment="Right" IsHitTestVisible="False" IsTabStop="False" Margin="0,0,28,0" Grid.Row="2" Grid.Column="1" d:LayoutOverrides="GridBox">
         <telerik:StyleManager.Theme>
          <telerik:Office_BlackTheme/>
         </telerik:StyleManager.Theme>
         <telerik:ScrollPositionIndicator.Visibility>
          <Binding Mode="TwoWay" Path="IsScrolling" RelativeSource="{RelativeSource TemplatedParent}">
           <Binding.Converter>
            <telerik:BooleanToVisibilityConverter/>
           </Binding.Converter>
          </Binding>
         </telerik:ScrollPositionIndicator.Visibility>
        </telerik:ScrollPositionIndicator>
        <Border x:Name="PART_FrozenColumnsPreview" Background="#33000000" HorizontalAlignment="Stretch" Grid.Row="2" Grid.RowSpan="1" Visibility="Collapsed" VerticalAlignment="Stretch" Width="Auto" Margin="0,0,5,0"/>
        <telerik:GridViewLoadingIndicator x:Name="PART_GridViewLoadingIndicator" Grid.ColumnSpan="2" IsTabStop="False" Grid.RowSpan="3" Visibility="Collapsed">
         <telerik:StyleManager.Theme>
          <telerik:Office_BlackTheme/>
         </telerik:StyleManager.Theme>
        </telerik:GridViewLoadingIndicator>
       </Grid>
      </Border>
     </AdornerDecorator>
     <ControlTemplate.Triggers>
      <Trigger Property="IsBusy" Value="True">
       <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Visible"/>
      </Trigger>      <Trigger Property="IsBusy" Value="False">
       <Setter Property="Visibility" TargetName="PART_GridViewLoadingIndicator" Value="Collapsed"/>
      </Trigger>      <Trigger Property="ShowColumnFooters" Value="False">
       <Setter Property="Visibility" TargetName="PART_FooterRow" Value="Collapsed"/>
      </Trigger>      <Trigger Property="ShowColumnHeaders" Value="False">
       <Setter Property="Visibility" TargetName="PART_HeaderRow" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="ShowGroupPanel" Value="False">
       <Setter Property="Visibility" TargetName="PART_GroupPanel" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="ComputedVerticalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
       <Setter Property="Width" TargetName="ScrollBarColumn" Value="0"/>
      </Trigger>
      <Trigger Property="ComputedHorizontalScrollBarVisibility" SourceName="PART_ItemsScrollViewer" Value="Collapsed">
       <Setter Property="Height" TargetName="ScrollBarRow" Value="0"/>
       <Setter Property="Grid.RowSpan" TargetName="PART_ItemsScrollViewer" Value="1"/>
      </Trigger>      <Trigger Property="ShowInsertRow" Value="True">
       <Setter Property="Visibility" TargetName="PART_AddNewRow" Value="Visible"/>
      </Trigger>     </ControlTemplate.Triggers>    </ControlTemplate>
   </Setter.Value>  </Setter>  <Setter Property="Background" Value="White"/>
  <Setter Property="BorderBrush" Value="#FF848484"/>
  <Setter Property="Foreground" Value="Black"/>
  <Setter Property="BorderThickness" Value="1"/>
  <Setter Property="AlternateRowBackground" Value="#FFF4F4F4"/>
  <Setter Property="VerticalGridLinesBrush" Value="#FFCBCBCB"/>
  <Setter Property="HorizontalGridLinesBrush" Value="#FFCBCBCB"/>
  <Setter Property="GroupPanelBackground">   <Setter.Value>
    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
     <GradientStop Color="#FFDFDFDF" Offset="1"/>
     <GradientStop Color="#FFBABABA"/>
    </LinearGradientBrush>   </Setter.Value>
  </Setter>  <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
  <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>  <Setter Property="VerticalAlignment" Value="Stretch"/>
  <Setter Property="HorizontalAlignment" Value="Stretch"/>
  <Setter Property="SnapsToDevicePixels" Value="True"/>
 </Style>


I don't really understand this message error, could you please help me with this issue.


Regards,

Benoît.
Benoît
Top achievements
Rank 1
 answered on 03 Feb 2014
5 answers
153 views
My calendar, see attached image, when setting the theme to Office 2013 loses some of the key styling.  The days seem to be missing, selected range doesn't show any highlighting, and the current day is not formatting the day fore color.

Any assistance would be greatly appreciated.



<UserControl.Resources>
    <ResourceDictionary>
        <telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
  
        <DataTemplate x:Name="cFontTemplate"
                  x:Key="cFontTemplateKey">
            <TextBlock Text="{Binding Text}"
                   Foreground="Black"
                   FontWeight="ExtraBold" />
        </DataTemplate>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Chart.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>
Yana
Telerik team
 answered on 03 Feb 2014
4 answers
392 views
Hi,

I would like to know when Information Layer is preferred over Visualization Layer and vice versa.

Thank you !
Abder Rezak
Top achievements
Rank 1
 answered on 31 Jan 2014
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
DataPager
PersistenceFramework
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?