Telerik Forums
UI for WPF Forum
1 answer
61 views

Hi,

I want to change One item angle. because my program use 6 items in radialmenu but it already splite as if use 8 items (One Item Degree = 45). then i use 6 items. i want to change 60 degree of one item.

 

im korean 20 developer so, im do not think my english grammar is well.

if you look difficult my grammar. im sorry and thank you for response.

정말 감사합니다.(= thank you so much)

Vladimir Stoyanov
Telerik team
 answered on 23 Sep 2020
5 answers
437 views

I want Export a chart in pdf file and image file. I use MVVM. I define a cartesian chart in view model and export that. but is some problem in export.

My chart is like "Ui.png" and in xaml that work correct.

* But in pdf file ("Export.pdf"):

1- label of Axis overwrite on corner.

2- some of curve have dasharray (you can see in "Ui.png") but dosen't set.

3- I define a Plot band Annotation (you can see in "Ui.png") but dosen't set.

* And in png file ("Export.png") only show Axis label.

My code for export

--------------------------------------------------------------------------------------------------------

RadFixedDocument document = new RadFixedDocument();
Chart = CreateChart();
document.Pages.Add(CreateChartPdfPart());

PdfFormatProvider provider = new PdfFormatProvider();
provider.Export(document, fileStream);

--------------------------------------------------------------------------------------------------------

public RadCartesianChart CreateChart()
        {
            RadCartesianChart Chart = new RadCartesianChart();
            DoubleCollection dashArray = new DoubleCollection { 10, 1, 1, 1 };
            FontFamily fontFamily = new FontFamily(Properties.Settings.Default.FontFamily);
            Chart.BeginInit();

            DateTimeContinuousAxis AxisX = new DateTimeContinuousAxis();
            AxisX.PlotMode = AxisPlotMode.OnTicks;
            AxisX.LabelFitMode = AxisLabelFitMode.Rotate;
            AxisX.ShowLabels = true;
            Chart.HorizontalAxis = AxisX;

            LinearAxis LengthAxis = new LinearAxis();
            LengthAxis.HorizontalLocation = AxisHorizontalLocation.Right;
            LengthAxis.LineDashArray = dashArray;
            TextBlock txt = new TextBlock();
            var RotateLabel = new Style(typeof(TextBlock));
            Setter setter = new Setter(TextBlock.RenderTransformProperty, new RotateTransform() { Angle = 180, CenterX = 50, CenterY = 50 });
            RotateLabel.Setters.Add(setter);
            txt.Style = RotateLabel;
            txt.Text = string.Format(CultureInfo.CreateSpecificCulture("en-US"), "Difference (cm)");
            LengthAxis.Title = txt.Text;

            var ColorLabel = new Style(typeof(TextBlock));
            Setter sett = new Setter(TextBlock.ForegroundProperty, new SolidColorBrush(Colors.Black));
            LengthAxis.LabelStyle = ColorLabel;
            LengthAxis.ShowLabels = true;

            LinearAxis PercentageAxis = new LinearAxis();
            PercentageAxis.HorizontalLocation = AxisHorizontalLocation.Left;
            PercentageAxis.Title = string.Format(CultureInfo.CreateSpecificCulture("en-US"), ""); //"Difference (%)"
            PercentageAxis.ShowLabels = true;
            Chart.VerticalAxis = PercentageAxis;

            Chart.Width = sizeA4.Width - 40;
            Chart.Height = (sizeA4.Width - 40) * (2.0 / 3.0);

            CartesianPlotBandAnnotation BandAnnotation = new CartesianPlotBandAnnotation();
            BandAnnotation.Axis = PercentageAxis;
            BandAnnotation.From = DownWarn;
            BandAnnotation.To = UpWarn;
            BandAnnotation.BorderBrush = new SolidColorBrush(Colors.Green);
            BandAnnotation.Fill = new SolidColorBrush(Colors.Green);
            Chart.Annotations.Add(BandAnnotation);

            CartesianGridLineAnnotation GridLineAnnotationMinFail = new CartesianGridLineAnnotation();
            GridLineAnnotationMinFail.Axis = PercentageAxis;
            GridLineAnnotationMinFail.Value = DownFailure;
            GridLineAnnotationMinFail.Stroke = new SolidColorBrush(Colors.Red);
            GridLineAnnotationMinFail.DashArray = new DoubleCollection { 5, 5 };
            GridLineAnnotationMinFail.StrokeThickness = 0.5;
            Chart.Annotations.Add(GridLineAnnotationMinFail);

            CartesianGridLineAnnotation GridLineAnnotationMaxFail = new CartesianGridLineAnnotation();
            GridLineAnnotationMaxFail.Axis = PercentageAxis;
            GridLineAnnotationMaxFail.Value = UpFailure;
            GridLineAnnotationMaxFail.Stroke = new SolidColorBrush(Colors.Red);
            GridLineAnnotationMaxFail.DashArray = new DoubleCollection { 5, 5 };
            GridLineAnnotationMaxFail.StrokeThickness = 0.5;
            Chart.Annotations.Add(GridLineAnnotationMaxFail);

            CartesianChartGrid ChartGrid = new CartesianChartGrid();
            ChartGrid.MajorLinesVisibility = GridLineVisibility.X;
            ChartGrid.StripLinesVisibility = GridLineVisibility.Y;
            ChartGrid.IsTabStop = false;
            ChartGrid.YStripeBrushes.Add(new SolidColorBrush(Colors.Gray));
            Chart.Grid = ChartGrid;

            int i = 0;
            foreach (var data in Data)
            {
                LineSeries lineSeries;
                if (chekboxSeries[i])
                {
                    if (i == 0 || i == 1 || i == 2 || i == 7 || i == 8)
                    {
                        lineSeries = new LineSeries
                        {
                            Stroke = new SolidColorBrush(newColor[i]),
                            StrokeThickness = 0.5,
                            DashArray = dashArray
                        };
                    }
                    else
                    {
                        lineSeries = new LineSeries
                        {
                            Stroke = new SolidColorBrush(newColor[i]),
                            VerticalAxis = LengthAxis,
                            DashArray = dashArray,
                            StrokeThickness = 0.5
                        };
                    }
                    foreach (var item in data.Items)
                    {
                        lineSeries.DataPoints.Add(new CategoricalDataPoint { Category = item.Date, Value = item.Value });
                    }
                    Chart.Series.Add(lineSeries);
                }
                i++;
            }
            Chart.EndInit();
            Chart.Measure(new Size(Chart.Width, Chart.Height));
            Chart.Arrange(new Rect(new Point(0, 0), Chart.DesiredSize));
            return Chart;
        }

--------------------------------------------------------------------------------------------------------

private RadFixedPage CreateChartPdfPart()
        {
            int margin = 20;
            var page = new RadFixedPage();
            page.Size = sizeA4;
            var editor = new FixedContentEditor(page, Telerik.Windows.Documents.Fixed.Model.Data.MatrixPosition.Default);

            using (editor.SavePosition())
            {
                editor.Position.Translate(margin, margin);
                ExportUIElement.ExportHelper.ExportToPdf(Chart, editor);
            }
            return page;
        }

--------------------------------------------------------------------------------------------------------

private void ExportPNGToImage(FrameworkElement element, Stream stream)
        {
            Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(element, stream, new PngBitmapEncoder());
        }

 

What is wrong?

 

Dilyan Traykov
Telerik team
 answered on 22 Sep 2020
3 answers
840 views
Hi,
In Telerik WPF Help file, in  Getting Started of RadGridView, there is a very simple sample.
Yeah it's too simple for my needs, so I add a Background property to Employee Class as follow:

public SolidColorBrush Background { set; get; }

Then in XAML, Changed say, <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name"/>
to
<telerikGrid:GridViewDataColumn DataMemberBinding="{Binding LastName}" Background="{Binding Background} Header="Last Name" />
But nothing happened :(

In some googling I come to some promising samples like:

<telerikGrid:GridViewDataColumn DataMemberBinding="{Binding LastName}">
                    <telerikGrid:GridViewDataColumn.Background>
                        <SolidColorBrush Color="{Binding Background}"/>
                    </telerikGrid:GridViewDataColumn.Background>
                </telerikGrid:GridViewDataColumn>

But unfortunately it didn't work either.
Any suggestions?
Thanks in advance.
Vladimir Stoyanov
Telerik team
 answered on 21 Sep 2020
11 answers
1.8K+ views

Our application has a form with multiple wide WatermarkTextboxes (and other textbox-like controls, e.g. MaskedDateTimeInput) in a grid layout. Most of them are single-line but some might become multiline, if the user enters long texts. The attached screenshot shows the form region where the problem becomes the most apparent.

Since each textbox, by default, has its own ScrollViewer that swallows all incoming scroll events, scrolling the main form via mouse wheel becomes pretty much impossible.

Browsers, such as Firefox, circumvent this issue by bubbling scroll events to the parent, whenever the child scrollviewer reaches its end. We could add this kind of workaround via an attached behavior but as our form is quite large, this would become ugly really soon. Is there any better solution and if not, would this be something that can be made possible in a future release?

 

 

 

 

 

 

 

 

 

 

 

Simon
Top achievements
Rank 1
 answered on 21 Sep 2020
6 answers
2.1K+ views

Good Day.

 

Is there a way the have the WatermarkTextBox accept multi line text including next lines? I dont want to use the RadRichTextBox as it looks much complicated the what I needed. I just need a simple multi line textbox.

 

Also, I noticed that with WatermarkTextBox, It does not set the caret to the end of the text when I input a long text. As a result, it only displays the first part of the long text when typing. I already set the property  SelectionOnFocus to CaretToEnd.

It only shows the expected behavior when I navigate to the end of the text then type again

gerardo
Top achievements
Rank 1
Veteran
 answered on 20 Sep 2020
3 answers
399 views

Hello,

I'm using: Telerik 2019.1.116.45

1. I'm looking to display code in a read only view.  I have found the RichTextBox API for insert code block and I like the formatting and key word coloring for the CSharp setting.  I am wondering how can I interact with the Codeblock through MVVM, instead of calling the insert code api.  

 

2.  I have found that it takes a bit of time to load when the code is perhaps around 60-70 lines.  Any way/settings I can set to increase the speed?

Tanya
Telerik team
 answered on 18 Sep 2020
3 answers
370 views

Hello 

I am trying to migrate a WPF app to PRISM 7. 

The MainWindow (Shell) is a RadRibbonWindow, hence it doe not migrate as it seems it is not of type Window.

I followed the instructions highlighted here (https://docs.telerik.com/devtools/wpf/knowledge-base/kb-radwindow-prismapplication-createshell), but I am missing a critical piece of information.

- Where do I find the "TelerikShell" type? Which dll, out of the many Telerik dlls that comes with WPF?

Also, if you have a working sample application that used PRISM 7 that you can sher would appreciate it.

 

Thanks

Herald

Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
16 answers
1.1K+ views
Is it possible to use a separate TextBox for the full text search? I'd would like to put the search text box in a toolbar on the UI.

Thanks,
Richard
Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
1 answer
167 views
Hello,

during our development process we've been facing some problems with
one of your products (RadTimeline for WPF).

Situation:
Using the RadTimeline in WPF we have been trying to display expandable/collapsible timeline items,
the general idea is that each timeline item consists of a label and a RadExpander which contains a list of additional information, the size of the list varies from each timeline item to the next.

And while the timeline items themselves work as intended, their positioning on the timeline doesn’t.

While all items are collapsed, their positioning on the timeline is correct,
but when one or more items are expanded, the positioning of these items gets inconsistent,
with some items overlapping others and/or items moving down horizontally.
The hight of the timeline itself seems to increase disproportionally when items are expanded, even if there would have been enough place for them to be displayed on the timeline without its height being increased.

We would like to know if it is possible for timeline items to have different sizes,
And should this not be supported by the RadTimeline out of the box,
is there a way to modify the behaviour based on which the items are positioned on the timeline.
Dilyan Traykov
Telerik team
 answered on 18 Sep 2020
1 answer
186 views
Hi,

Our application have predefined document variables and we put these variables inside documents. Some of the variables contains singleline text but some of them have multiline text. For multiline text we add \v vertical tab for line break. When we add line break RadRichTextBox UI shows as we expected.
For example we added a text "Progress Telerik\vVertical Tab Test Second Line\vThird Line" and RadRichTextBox UI shows as

Progress Telerik
Vertical Tab Test Second Line
Third Line

But when we exported these xaml file as xaml format, final xaml file is not the same as shown in RadRichTextBox UI. The last line repeated for all the lines. Exported xaml file repeates "Third Line" line as shown below.


<t:Paragraph TextAlignment="Center">
  <t:FieldRangeStart AnnotationID="1">
    <t:DocumentVariableField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" VariableName="D_ALICI" />
  </t:FieldRangeStart>
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:Break BreakType="LineBreak" Text="¬" />
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:Break BreakType="LineBreak" Text="¬" />
  <t:Span BaselineAlignment="Baseline" FontFamily="Times New Roman" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" HighlightColor="#00FFFFFF" Strikethrough="False" Text="Third Line" ThemeForeColorShade="" ThemeForeColorTint="" ThemeUnderlineColorShade="" ThemeUnderlineColorTint="" UnderlineColor="#FF000000" UnderlineDecoration="None" />
  <t:FieldRangeEnd AnnotationID="1" />
</t:Paragraph>


How can we solve this problem?

You can download sample application and final xaml file from  https://we.tl/t-KYQh8XpGfF

Martin
Telerik team
 answered on 16 Sep 2020
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?