Telerik Forums
UI for WPF Forum
3 answers
100 views

https://docs.telerik.com/devtools/wpf/controls/raddatetimepicker/styles-and-templates/styling-raddatetimepicker

After extracting the default style for RadDateTimePicker to the resource file to my application (as mentioned in the above page.), RadDateTimePicker is not working as expected.

For current month it picks up the correct date that is selected in the calendar. But for previous months and next months, it is picking up different date than selected.

telerik version- R1 2020

Attached the screenshot.

 

Vladimir Stoyanov
Telerik team
 answered on 23 Sep 2020
7 answers
613 views

Im using Telerik WPF Docking for my app. Some RadPanes have Canvas inside, for drawings (some are complex drawings, other are simple drawings. All the drawings are programmatically created). The problem is: the drawings look "weird" (see example). Im 100% sure my drawing functions are ok (my app is not new, just recently im trying to improve it with a Docking Manager). If I remove all the references to de Telerik Docking, the drawings are OK. If I use another docking (from another developer), the drawings are OK. In the debugging, coordinates, scales, margins, etc, are OK. If I add a Line with some coordinates, and then a Rectangle with same coordinates (see the example), the drawing looks deformed.

Help!

 

Vladimir Stoyanov
Telerik team
 answered on 23 Sep 2020
1 answer
66 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
441 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
860 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
405 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
377 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
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?