Telerik Forums
UI for WPF Forum
5 answers
329 views

Hi,

I have two questions:

1- is it possible to set the default value of the zoomcontroller to "automatic" instead of 100 %?  if possible in XAML, or in code-behind is necessary

 

2- is there a way (documented or code snippet) so I can filter the export format (i.e.: I only want PNG files)

 

Thanks

Louis-Guillaume
Top achievements
Rank 1
 answered on 11 Feb 2017
1 answer
155 views

Hey,

Is there way to disable cutting letters from PDF? When I am loading PDF file it is cutting polish words, is there any chance to avoid this?

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 10 Feb 2017
3 answers
161 views

I have a radgridview with a bunch of columns. Each column has defined how to group and sort.

For instance:

  • The data: MeetingDate is a of a custom type, which has a Tostring()-override that returns the datetime as date only (and implements IComparable<T>, IEquatable<T>
  • GroupHeaderTemplate: Writes the date if there is one. Writes "None" otherwise
<telerik:GridViewDataColumn x:Name="_meetingDateColumn" IsReadOnly="True"
                                Header="Meeting date"
                                DataMemberBinding="{Binding MeetingDate.TheDateTime, UpdateSourceTrigger=PropertyChanged}"
                                GroupHeaderTemplate="{StaticResource GridDateColumnGroupHeaderTemplate}"
                               Width="SizeToCells"
                                GroupMemberPath="MeetingDate">
                                <telerik:GridViewDataColumn.HeaderCellStyle>
                                    <Style TargetType="telerik:GridViewHeaderCell">
                                        <Setter Property="ToolTipService.ToolTip" Value="Date when meeting is taking place"/>
                                        <Setter Property="ToolTipService.ShowDuration" Value="{x:Static Member=system:Int32.MaxValue}" />
                                    </Style>
                                </telerik:GridViewDataColumn.HeaderCellStyle>
  
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate >
                                        <TextBlock VerticalAlignment="Top"
                                                Text="{Binding MeetingDate.TheDateTime, StringFormat={}{0:g}}"
                                                ToolTipService.Placement="Center" />
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>


I have around 20 columns, some are dates like the one above. One is industry, which groups by the category (http://ec.europa.eu/competition/mergers/cases/index/nace_all.html) but the column sorts by the entire industry name. Others are completely different - most have special handling of grouping and sorting.

The user is supposed to play around with grouping and sorting to find interesting stuff. However  - in addition - I would like to provide a few preset options, which the user should be able to choose in a drop down and have the grid re-arrange itself accordingly.

I would hate to implement all 20 grouping and sorting again - is there any way I can reuse the defination of sort and group from the columns in the gridview - and apply them to the radgridview group panel programatically ?

 

Thanks,

 

Stefan
Telerik team
 answered on 10 Feb 2017
18 answers
1.1K+ views
I am trying to chart a variable number of series, any of which can either be displayed as point series (using bar series) or line series. I've managed to get TypePath to work to successfully vary the series type dynamically. However, I have 2 questions:

1. How can I apply Styles to the two different types of series? CategoricalSeriesDescriptor only takes a single Style, and that Style only accepts Properties of the specified TargetType; I can't figure out how to set styles for each series type.

2. (How) can I use a converter to supply the ChartView with the Series Type so that the ViewModel in MVVM doesn't have to supply telerik types to the View? TypePath doesn't allow a binding (I get "System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element." if I try) so I can't apply the "Converter" tag.

If there's a better way to display variable numbers of series using 2 different series types please do point it out as well.

Thanks,
Louis
Johannes
Top achievements
Rank 1
 answered on 10 Feb 2017
3 answers
181 views
TiledMapSource GetTile method using bitmap source
How can I change the Uri for Bitmap Source?
Dinko | Tech Support Engineer
Telerik team
 answered on 10 Feb 2017
3 answers
219 views

I'm using the RadCartesianChart and the ScatterPointSeries for the chart view and was wondering if there is a way to permanently show the origin (0,0) on the axis.

I have the Minimum and Maximum of each axis defined by the points that are being plotted... so for instance it can occasionally display something like

X-Axis: min -0.034... to max 0.02...
Y-Axis: min -0.04... to max 0.035... etc.

The major grid lines obviously tries to account for the spacing between the min and max to produce equally spaced lines. This sometimes obscures the origin axis lines. I have been able to mitigate this is some situations by forcing the min and max to be equal absolute values... 

Taking my earlier example for instance, making:

X-Axis: min -0.04 to max 0.04
Y-Axis: min -0.04 to max 0.04

[See attached image "Test Working"]

Sometimes depending on the min/max and the spacing decided, the axis origin is still being hidden.

[See attached image "test Not Working"]

I was wondering if there is any way to force the origin (0,0) to be displayed at all times, i'm unable to find an option in the documentation, perhaps as a major grid line etc.

Sam
Top achievements
Rank 1
 answered on 10 Feb 2017
2 answers
298 views

Hi to all,

I doìt understand why I have several problems with Theme.

I can't see Theme applyed at design-time, when I run my project it works all perfectly.

Why?!?

I tryed to change Theme by wizard (configurator), but it not takes effect.

I tryed to clear cache of VS also, but nothing.

Dario Concilio
Top achievements
Rank 2
 answered on 10 Feb 2017
2 answers
444 views

Hello. I have simple example

XAML:

<telerik:RadComboBox 
    Width="100" Height="25"
    IsEditable="True" 
    Text="{Binding Value, Mode=TwoWay}" >
            <telerik:RadComboBoxItem Content="20"/>
            <telerik:RadComboBoxItem Content="10"/>
            <telerik:RadComboBoxItem Content="2"/>
            <telerik:RadComboBoxItem Content="1"/>
</telerik:RadComboBox>

 

ViewModel:

    public class ViewModel {
        public int Value { get; set; }
    }

 

Behavior:

    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();

            DataContext = new ViewModel() { Value = 2 };
        }
    }

ComboBox selected another value instead of '2'
Vitali
Top achievements
Rank 1
 answered on 10 Feb 2017
14 answers
565 views

I use dynamic numer of SplineSeries in my chart (so I use ChartSeriesProvider) and I want to display Chart Legend in the right upper corner of chart. But ChartSeriesProvider doesn't work with LegendSettings. An empty chart area is displayed. Please see 'EmptyChartArea.PNG' file attached. I did the following XAML markup:

<UserControl x:Class="DeviceReading.Views.AutomaticGainControlView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:local="clr-namespace:DeviceReading"
             xmlns:views="clr-namespace:DeviceReading.Views"
             prism:ViewModelLocator.AutoWireViewModel="True">
 
    <UserControl.Resources>
        <!--Series colors-->
        <telerik:ChartPalette x:Key="customPalette">
            <telerik:ChartPalette.SeriesEntries>
                <telerik:PaletteEntryCollection SeriesFamily="Line">
                    <telerik:PaletteEntry Fill="Blue" Stroke="Blue"/>
                    <telerik:PaletteEntry Fill="Crimson" Stroke="Crimson"/>
                    <telerik:PaletteEntry Fill="Green" Stroke="Green"/>
                    <telerik:PaletteEntry Fill="DarkOrange" Stroke="DarkOrange"/>
                    <telerik:PaletteEntry Fill="Purple" Stroke="Purple"/>
                    <telerik:PaletteEntry Fill="DarkTurquoise" Stroke="DarkTurquoise"/>
                    <telerik:PaletteEntry Fill="SaddleBrown" Stroke="SaddleBrown"/>
                    <telerik:PaletteEntry Fill="SlateBlue" Stroke="SlateBlue"/>
                </telerik:PaletteEntryCollection>
            </telerik:ChartPalette.SeriesEntries>
        </telerik:ChartPalette>
 
        <local:StringToLegendSettingsConverter x:Key="StringToLegendSettingsConverter"/>
    </UserControl.Resources>
 
<telerik:RadCartesianChart Visibility="{Binding IsAbsoluteSplineChartVisible}" Palette="{StaticResource customPalette}">
     <!--Turn scrollbars off-->
     <telerik:RadCartesianChart.Resources>
         <Style TargetType="telerik:PanZoomBar">
             <Setter Property="Visibility" Value="Collapsed"/>
         </Style>
     </telerik:RadCartesianChart.Resources>
     <!-- X-axis -->
     <telerik:RadCartesianChart.HorizontalAxis>
         <telerik:DateTimeContinuousAxis MajorStepUnit="Second" LabelInterval="5" LabelFormat="hh:mm:ss" FontFamily="Segoe UI" PlotMode="OnTicks" TickOrigin="{Binding AlignmentDate}"/>
     </telerik:RadCartesianChart.HorizontalAxis>
     <!-- Y-axis -->
     <telerik:RadCartesianChart.VerticalAxis>
          <telerik:LinearAxis FontFamily="Segoe UI" Title="Децибелы [Дб]" />
     </telerik:RadCartesianChart.VerticalAxis>
     <!--Coordinate grid-->
     <telerik:RadCartesianChart.Grid>
         <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineDashArray="3,4" MajorYLineDashArray="3,4"/>
     </telerik:RadCartesianChart.Grid>
     <!--Series Provider used-->
     <telerik:RadCartesianChart.SeriesProvider>
         <telerik:ChartSeriesProvider Source="{Binding SeriesData}">
             <telerik:ChartSeriesProvider.SeriesDescriptors>
                 <telerik:CategoricalSeriesDescriptor CategoryPath="Category" ValuePath="Value" ItemsSourcePath="ChartPoints">
                     <telerik:CategoricalSeriesDescriptor.TypeConverter>
                          <local:SeriesTypeConverter/>
                     </telerik:CategoricalSeriesDescriptor.TypeConverter>
                     <!--USE StringToLegendSettingsConverter-->
                     <telerik:CategoricalSeriesDescriptor.Style>
                          <Style TargetType="telerik:SplineSeries">
                              <Setter Property="LegendSettings" Value="{Binding  SeriesName, Converter={StaticResource StringToLegendSettingsConverter}}"/>
                          </Style>
                     </telerik:CategoricalSeriesDescriptor.Style>
                 </telerik:CategoricalSeriesDescriptor>
             </telerik:ChartSeriesProvider.SeriesDescriptors>
         </telerik:ChartSeriesProvider>
     </telerik:RadCartesianChart.SeriesProvider>
     <!--Zooming and Panning-->
     <telerik:RadCartesianChart.Behaviors>
         <telerik:ChartPanAndZoomBehavior DragMode="Pan" ZoomMode="Both"  PanMode="Both"/>
     </telerik:RadCartesianChart.Behaviors>
</telerik:RadCartesianChart>
</UserControl>

Below is StringToLegendSettingsConverter class:

public class StringToLegendSettingsConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return new SeriesLegendSettings { Title = "" + value };
    }
 
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Below is SeriesModel class (with Rusian remarks).

public class SeriesModel
{
        #region Constructors
        /// <summary>
        /// Создаёт экземпляр SeriesModel по умолчанию.
        /// </summary>
        public SeriesModel() { }
        /// <summary>
        /// Создаёт экземпляр SeriesModel  по заданным параметрам
        /// </summary>
        /// <param name="chartPoints">Тип серии (вид графика).</param>
        /// <param name="seriesType">Коллекция точек, представляющая серию (кривую графика).</param>
        public SeriesModel(RadObservableCollection<ChartPoint> chartPoints, string seriesName, string seriesType = "Spline")
        {
            this.ChartPoints = chartPoints;
            this.SeriesName = seriesName;
            this.SeriesType = seriesType;
        }
        #endregion
 
        #region Properties
 
        /// <summary>
        /// Тип серии (вид графика). Т.е. состоит ли график кривой из отрезков, просто соединяющих точки (LineChart),
        /// либо места, в которых отрезки соединяются с точками, имеют закруглённую форму (SplineCahrt).
        /// </summary>
        public string SeriesType { get; set; }
 
        /// <summary>
        /// Имя серии. Например, "1-й луч", "2-й луч" и т.д.
        /// </summary>
        public string SeriesName { get; set; }
 
        /// <summary>
        /// Коллекция точек, представляющая серию (кривую графика).
        /// </summary>
        public RadObservableCollection<ChartPoint> ChartPoints { get; set; }
 
        #endregion
}

Below is using SeriesModel Instance in 'AutomaticGainControlViewModel' class (ViewModel of 'AutomaticGainControl' chart) constructor for asigning to SeriesName property (with Rusian remarks):

. . . . . . . . . . . . . . .
// Создать и начать заполнять коллекцию точек для графиков кривых абсолютных значений.
this.SeriesData = new RadObservableCollection<SeriesModel>();
// Добавить точку для графика кривой коэффициента усиления на первом луче в прямом направлении.
series = new SeriesModel();
series.SeriesType = "Spline";
series.SeriesName = "P1AB";
series.ChartPoints = new RadObservableCollection<ChartPoint>();
automaticGainControl = this.Data[0].Value;
series.ChartPoints.Add(new ChartPoint(new DateTime(this._currentDate.Ticks), automaticGainControl));
this.SeriesData.Add(series);
// Добавить точку для графика кривой коэффициента усиления на первом луче в обратном направлении.
series = new SeriesModel();
series.SeriesType = "Spline";
series.SeriesName = "P1BA";
series.ChartPoints = new RadObservableCollection<ChartPoint>();
automaticGainControl = this.Data[1].Value;
series.ChartPoints.Add(new ChartPoint(new DateTime(this._currentDate.Ticks), automaticGainControl));
this.SeriesData.Add(series);
// Добавить точку для графика кривой коэффициента усиления на втором луче в прямом направлении.
series = new SeriesModel();
series.SeriesType = "Spline";
series.SeriesName = "P2AB";
series.ChartPoints = new RadObservableCollection<ChartPoint>();
automaticGainControl = this.Data[2].Value;
series.ChartPoints.Add(new ChartPoint(new DateTime(this._currentDate.Ticks), automaticGainControl));
this.SeriesData.Add(series);
// Добавить точку для графика кривой коэффициента усиления на втором луче в обратном направлении.
series = new SeriesModel();
series.SeriesType = "Spline";
series.SeriesName = "P2BA";
series.ChartPoints = new RadObservableCollection<ChartPoint>();
automaticGainControl = (ushort)this.Data[3].Value;
series.ChartPoints.Add(new ChartPoint(new DateTime(this._currentDate.Ticks), automaticGainControl));
this.SeriesData.Add(series);
. . . . . . . . . . . . . .

And, just in case, I bring a 'SeriesTypeConverter' converter class source code here:

public class SeriesTypeConverter : IValueConverter
{
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            SeriesModel seriesItem = value as SeriesModel;
 
            if (seriesItem.SeriesType == "Spline")
            {
                return typeof(SplineSeries);
            }
            else
            {
                return typeof(LineSeries);
            }
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
}

What have I done wrong in my program that I have the empty chart. How to correct the error. Thank you very much in advance.

Dmitry
Top achievements
Rank 1
 answered on 10 Feb 2017
4 answers
516 views

Hi,

I am trying to build a stacked bar chart in wof 4.0 using telerik version 2012.1.326.40.

I am able to do so by using telerik:RadCartesianChart.SeriesProvider in 4.5 but as the SeriesProvider is absent in the earlier version it is hard for me to construct the same.

I am trying to achieve a chart attached.

Please advise.

dec698
Top achievements
Rank 1
 answered on 10 Feb 2017
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?