Telerik Forums
UI for WPF Forum
2 answers
284 views
After upgrading to WPF Q2 2014, the StrokeDashArray property stopped working for me.  I confirmed with the same project linking to Q1 2014 that the property is working.

Here is the XAML that reproduces the issue.  Any ideas?  Note that the Stroke and StrokeThickness properties are being updated correctly to Red and thickness 2.  It's just the StrokeDashArray that stopped working.

<chartView:ScatterLineSeries ItemsSource="{Binding LineData}" XValueBinding="XValue" YValueBinding="YValue">
     <chartView:ScatterLineSeries.StrokeShapeStyle>
          <Style TargetType="Path">
               <Setter Property="Stroke" Value="Red"/>
               <Setter Property="StrokeDashArray" Value="10 5"/>
               <Setter Property="StrokeThickness" Value="2"/>
          </Style>
     </chartView:ScatterLineSeries.StrokeShapeStyle>
</chartView:ScatterLineSeries>
Martin Ivanov
Telerik team
 answered on 26 Sep 2014
1 answer
165 views
I'm implementing a wpf application with rad control 2014 to export radreport to Rtf and save as byte to database then retrieve the data from database and display in RadRichTextBox.

here's my code:

Export to rtf format and save to database
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
 Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;
Telerik.Reporting.Processing.RenderingResult renderedReport = reportProcessor.RenderReport("RTF", instanceReportSource, null);

and save the output of renderedReport.DocumentBytes to database. 

Load the byte[] and bind to RadRichTextBox
RadDocument document = null;
IDocumentFormatProvider provider = new RtfFormatProvider();
using (Stream stream = new MemoryStream(viewDocumentsCore.DocumentContent))
{
    document = provider.Import(stream);
}
 
radRichTextBox.Document = document;

But it causes error.

I would appreciate for any help.

Hassan
Regards
Petya
Telerik team
 answered on 25 Sep 2014
1 answer
575 views
Is there a simple way to change the Input box border color on focus and on mouse over without overwriting the entire style.
Kalin
Telerik team
 answered on 25 Sep 2014
1 answer
153 views
I have WPF application and 2 RadCartesianChart (please see my screenshot attach)

This is the code of one of them (they both identical):

<telerik:RadCartesianChart x:Name="ccPacketsPerSeconds" Margin="145,392,53,-119">
<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorXLineDashArray="5, 5" MajorYLineDashArray="5, 5" MajorLinesVisibility="None">
<telerik:CartesianChartGrid.MajorYLineStyle>
<Style TargetType="{x:Type Line}">
<Setter Property="Stroke" Value="Gray"/>
</Style>
</telerik:CartesianChartGrid.MajorYLineStyle>
<telerik:CartesianChartGrid.MajorXLineStyle>
<Style TargetType="{x:Type Line}">
<Setter Property="Stroke" Value="Gray"/>
</Style>
</telerik:CartesianChartGrid.MajorXLineStyle>
</telerik:CartesianChartGrid>
</telerik:RadCartesianChart.Grid>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis ShowLabels="False" IsEnabled="False" Minimum="-5"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.HorizontalAxis >
<telerik:CategoricalAxis ShowLabels="False" IsEnabled="False"/>
</telerik:RadCartesianChart.HorizontalAxis>
</telerik:RadCartesianChart>

And i want to change 2 things:

1. the color of the line
2. remove the y axis that remained.

I try to change almost all the properties and it still the same so i will glad for some help.



Martin Ivanov
Telerik team
 answered on 25 Sep 2014
1 answer
290 views
I'm trying to have Validation errors for my RadMaskedTextBox, Currently I was able to do that but it's dynamic and I want to change that.If I set the range only < 250, and I put 500 inside the textbox it'll trigger and the Validation Error will appear.What I want to happen is the Validation Error only happen when my button is pressed. May I ask how do I convert to do that?
Xaml

<ControlTemplate x:Key="validationTemplate">
    <DockPanel>
        <AdornedElementPlaceholder />
        <TextBlock FontSize="20" Foreground="Red">Error!</TextBlock>
    </DockPanel>
</ControlTemplate>

<controls:RadMaskedCurrencyInput
    x:Name="radMaskedCurrencyInput"
    InputBehavior="Insert"
    Validation.ErrorTemplate="{StaticResource validationTemplate }"
    Value="{Binding Path=DecimalValue,
    ValidatesOnDataErrors=True,
    ValidatesOnExceptions=True,
    NotifyOnValidationError=false,
    UpdateSourceTrigger=PropertyChanged}" />

<Button Content="Execute" cal:Message.Attach="[Click] = [ExecuteMessage]"/>ViewModel:private decimal decimalValue;

public decimal DecimalValue
{
    get { return decimalValue; } 
    set
    {
    if (value > 250)
    {
        throw new ValidationException("Value cannot be greater than 250.");
    }
    else
    decimalValue = value;
    this.OnPropertyChanged("DecimalValue");
    }
}
Pavel R. Pavlov
Telerik team
 answered on 25 Sep 2014
4 answers
373 views
I have a WPF MVVM application with a screen that has a Telerik Chart(RadCartesianChart) on it. The chart can contain more than one series in it. I need to have at least one of the series be clickable and based on the click execute a command in the View Model sending it the point (or at least the X axis) on the line that was clicked.

I believe I need to set the Command and CommandParameter in the codebehind of the page, but not sure how.

In the end I need the click command of the series to execute the PlotChartItemClickedCommand Sending it a parameter containing the X axis data which in my case is the Category.

Below is my code XAML, CodeBehind and VM. Any help would be greatly appreciated

XAML:
<telerik:RadCartesianChart x:Name="RccLineChart"
                              Width="354"
                              Height="300" >
    <telerik:RadCartesianChart.Resources>
        <DataTemplate x:Key="PointTemplate">
            <Ellipse Height="6" Width="6" Fill="red" />
        </DataTemplate>
    </telerik:RadCartesianChart.Resources>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis ShowLabels="False" Title="Count" x:Name="LineHorzAxis"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="{Binding Path=MaxYValue}" Minimum="{Binding Path=MinYValue}" Title="C"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

CodeBehind:
public CodeBehindConstructor()
{
    InitializeComponent();
    InitialIzeLineChart();
}
 
private void InitialIzeLineChart()
{
    foreach (CartesianSeries series in GetSeries())
    {
        RccLineChart.Series.Add(series);
    }
}
 
private IEnumerable<CartesianSeries> GetSeries()
{
    string Line1ItemsSourcePath = string.Empty;
    string PointsItemsSourcePath = string.Empty;
    string referenceLineItemsSourcePath = string.Empty;
    string Line1Resource = string.Empty;
    string PointsResource = string.Empty;
    Line1Resource = "Line1Template";
    PointsResource = "PointTemplate";
 
    CategoricalSeries Line1Series = null;
    CategoricalSeries PointSeries = null;
    CategoricalSeries referenceLineSeries = null;
    Line1Series = new LineSeries();
    PointSeries = new PointSeries();
    referenceLineSeries = new LineSeries();
 
    Line1ItemsSourcePath = "Line1Data";
    PointsItemsSourcePath = "PointsData";
    referenceLineItemsSourcePath = "ReferenceLine";
 
    List<CartesianSeries> generatedSeries = new List<CartesianSeries>();
    Line1Series.CategoryBinding = new PropertyNameDataPointBinding("Category");//this is what we want to send to the VM on the click of the chart
    Line1Series.ValueBinding = new PropertyNameDataPointBinding("Data");
    Line1Series.ShowLabels = false;
    Line1Series.CombineMode = ChartSeriesCombineMode.None;
    Line1Series.IsHitTestVisible = true;
    Line1Series.SetBinding(CategoricalSeries.ItemsSourceProperty, new Binding(Line1ItemsSourcePath));
    Line1Series.PointTemplate = this.Resources[Line1Resource] as DataTemplate;
 
    //CommandBinding lineCB = new CommandBinding();
    //ICommand lineCommand = new ICommand();
     
    generatedSeries.Add(Line1Series);
 
    PointSeries.CategoryBinding = new PropertyNameDataPointBinding("Category");
    PointSeries.ValueBinding = new PropertyNameDataPointBinding("Data");
    PointSeries.ShowLabels = true;
    PointSeries.CombineMode = ChartSeriesCombineMode.None;
    PointSeries.SetBinding(CategoricalSeries.ItemsSourceProperty, new Binding(PointsItemsSourcePath));
    PointSeries.PointTemplate = this.Resources[PointsResource] as DataTemplate;
 
    generatedSeries.Add(PointSeries);
 
    referenceLineSeries.CategoryBinding = new PropertyNameDataPointBinding("Category");
    referenceLineSeries.ValueBinding = new PropertyNameDataPointBinding("Data");
    referenceLineSeries.ShowLabels = false;
    referenceLineSeries.CombineMode = ChartSeriesCombineMode.None;
    referenceLineSeries.IsHitTestVisible = true;
    referenceLineSeries.SetBinding(CategoricalSeries.ItemsSourceProperty, new Binding(referenceLineItemsSourcePath));
    referenceLineSeries.PointTemplate = this.Resources[Line1Resource] as DataTemplate;
 
    generatedSeries.Add(referenceLineSeries);
 
    return generatedSeries;
}

ViewModel:
public RelayCommand<ChartItemClickEventArgs> PlotChartItemClickedCommand
{
    get { return new RelayCommand<ChartItemClickEventArgs>(PlotChartItemClickedExecute, AlwaysTrueCanExecute); }
}
 
private void ProfilePlotChartItemClickedExecute(object e)
{
    int xPointClicked = ?????
 
}



Petar Marchev
Telerik team
 answered on 25 Sep 2014
12 answers
93 views
Hello,

I installed the Q2 SP1 and now the RadComboBox shows different than before.
How can I reuse the Windows8 Theme?
Masha
Telerik team
 answered on 25 Sep 2014
3 answers
409 views
Hi I'm trying to display a System.Windows.Controls.WebBrowser in a RadWindow. The WebBrowser does not appear to render properly. The WebBrowser control is there (I can right click and display the context menu) but the page it displays is not visible? The following code snippets should demonstrate the issue...
Create the RadWindow in response to a button click...
<Window x:Class="TelerikForm.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    Title="Window1" Height="300" Width="300"
    <Grid> 
    <Button Name="launchWindow" Content="launchNewWindow" Click="launchWindow_Click" /> 
  </Grid> 
</Window> 
private void launchWindow_Click(object sender, RoutedEventArgs e) { 
  RadWindow testWindow = new RadWindow(); 
  testWindow.Content = new Browser(); 
  testWindow.Show(); 
And add some content containing the WebBrowser...
<UserControl x:Class="TelerikForm.Browser" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="600" Height="600"
    <StackPanel> 
    <Border Width="590" Height="590" Margin="5" BorderBrush="Black" BorderThickness="1"
      <WebBrowser Name="browser" Loaded="browser_Loaded" > 
      </WebBrowser>       
    </Border> 
    </StackPanel> 
</UserControl> 
private void browser_Loaded(object sender, System.Windows.RoutedEventArgs e) {       
      browser.Navigate(new Uri("http://www.google.co.uk/", UriKind.RelativeOrAbsolute), nullnull""); 
Thanks in advance..Simon...
Datafyer
Top achievements
Rank 1
 answered on 25 Sep 2014
7 answers
98 views
I noticed a great deal of files being supported. Is there a way to import outlook emails? Either directly from pst or some intermediate method?
Petya
Telerik team
 answered on 24 Sep 2014
5 answers
143 views
I've extended the demo such that the minimap displays about two hours of time, and the main scheduleview displays about 10 minutes.

What I'd like is for movement of the timebar on the minimap to change the horizontal scrolling of the timeline in the scheduleview. And vice versa.

From what I can tell, the original code timebar simple adjusted "VisibleDays" in the scheduleview. Since I am always much less than a day this is no longer a good way to synchronize views.

Is there a way to bind the timebar slider value to the horizontal slider value on the scheduleview? I've attached a screenshot.
Yana
Telerik team
 answered on 24 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?