Telerik Forums
UI for WPF Forum
6 answers
108 views

Hi,

We are looking into upgrading our Telerik UI for WPF 2013Q1 to 2018Q3.

As part of the POC process I encountered the following blocking issue.

I need to upgrade this code to Telerik UI for WPF 2018 Q3 but wasn't able to do so after consulting the documentation available on the web.

The main issue is converting the removed\obsolete GridViewElementExportingEventArgs.Attributes["border"] and GridViewElementExportingEventArgs.Styles["background-color"] from 2013Q1 to 2018Q3.

 

Can you help me solve this upgrade blocking issue?

 

Thanks in advance

01.private static RadDocument CreateDocument(RadGridView grid, PrintSettings settings)
02.        {
03.            RadDocument document = null;
04. 
05.            using (var stream = new MemoryStream())
06.            {
07.                EventHandler<GridViewElementExportingEventArgs> elementExporting = (s, e) =>
08.                {
09.                    if (e.Element == ExportElement.Table)
10.                    {
11.                        e.Attributes["border"] = "0";
12.                    }
13.                    else if (e.Element == ExportElement.HeaderRow)
14.                    {
15.                        if (settings.HeaderBackground != null)
16.                        {
17.                            e.VisualParameters
18.                            e.Styles.Add("background-color", settings.HeaderBackground.ToString().Remove(1, 2));
19.                        }
20.                    }
21.                    else if (e.Element == ExportElement.GroupHeaderRow)
22.                    {
23.                        if (settings.GroupHeaderBackground != null)
24.                        {
25.                            e.Styles.Add("background-color", settings.GroupHeaderBackground.ToString().Remove(1, 2));
26.                        }
27.                    }
28.                    else if (e.Element == ExportElement.Row)
29.                    {
30.                        if (settings.RowBackground != null)
31.                        {
32.                            e.Styles.Add("background-color", settings.RowBackground.ToString().Remove(1, 2));
33.                        }
34.                    }
35.                };
36. 
37.                grid.ElementExporting += elementExporting;
38. 
39.                grid.Export(stream, new GridViewExportOptions()
40.                {
41.                    Format = Telerik.Windows.Controls.ExportFormat.Html,
42.                    ShowColumnFooters = grid.ShowColumnFooters,
43.                    ShowColumnHeaders = grid.ShowColumnHeaders,
44.                    ShowGroupFooters = grid.ShowGroupFooters
45.                });
46. 
47.                grid.ElementExporting -= elementExporting;
48. 
49.                stream.Position = 0;
50. 
51.                document = new HtmlFormatProvider().Import(stream);
52.            }
53. 
54.            return document;
55.        }
Nir
Top achievements
Rank 1
 answered on 27 Nov 2018
1 answer
123 views

I have a crash I cannot reproduce in a test program. I'm allowing the user to change the number of maps on the screen from 1 to 4. When switching from 4 maps to 1 map (for example), I remove the DataContext for the maps that will be hidden. I do this because I will still be updating the ViewModel for every map and do not want the map to reflect these changes if it's not visible. This causes an instant crash for maps 3 and 4. Here is the applicable stack trace:

   at Telerik.Windows.Controls.Map.TilesVisualizationLayer.CalculateViewports()
   at Telerik.Windows.Controls.Map.TilesVisualizationLayer.MultiscaleImage_MotionFinished(Object sender, RoutedEventArgs e)
   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 Telerik.Windows.Controls.Map.MultiScaleImage.<RaiseMotionFinishedEvent>b__2()

It appears to crash because there is no longer a provider. Whether the map is visible or not makes no difference. Any ideas?

Jason D
Top achievements
Rank 1
Veteran
 answered on 26 Nov 2018
1 answer
312 views

Radpdfview showing blank for some pdf documents. I am binding the pdf viewer like: 

this.pdfDocumentViewer.DocumentSource = new PdfDocumentSource(new Uri(winModel.PdfPath));

My pdf file is like: 

%PDF-1.5
%âãÏÓ
1213 0 obj
<</Filter/FlateDecode/First 656/Length 2401/N 81/Type/ObjStm>>stream

And 

%PDF-1.7
<</Filter/FlateDecode/Length 128>>stream

Both pdf documents are scanned images. Need help.

Tanya
Telerik team
 answered on 26 Nov 2018
1 answer
176 views

I want to know how to have a behaviour for telerik:RadTreeListView so that on double clicking on row it should show it's row retailer. 

 

My work flow is as below.
1) Row has child rows, first Double clicking on it, it should show it's child rows. After another double click it should show it's row detailer. 

2) Revers also need to work like already row detailer got opened, then on double click it should collapse it. 

3) Everything should be in MVVM not code behind please. 

 

Please provide a sample application.

 

Stefan
Telerik team
 answered on 26 Nov 2018
3 answers
105 views

I use Vertical Linear Scale control as Bar control

Min = -50 and Max = 50

by timer i get values and each tick the bar is filled till the value that came from -50 till the value

but I want that  the start value to fill the bar will stay 0

For Example: if I will get value = 20 I want the bar will be filled from 0 to 20

and if i will get value = -20 I want the bar will be filled from -20 till 0

 

Thanks

Shoshana

Martin Ivanov
Telerik team
 answered on 26 Nov 2018
1 answer
184 views

I am developing a WPF (MVVM) application for weather forecasts/hindcasts using a RadMap (Bing maps underneath). I am overlaying the weather images using a VirtualizationLayer and all looks good. What I would like to do next is have a further layer with animated arrows depicting the strength/direction of the wind. Along with the weather tile images, I can also source raw data that will give me this info for a specific location. I came across a website that gives a decent example of what I am trying to achieve: https://www.windy.com/?38.307,-128.364,4 There appears to be some web component that is providing this animation. Would this be possible with a Telerik component?

regards,

Grant

 

Martin Ivanov
Telerik team
 answered on 26 Nov 2018
7 answers
413 views
Hi,
   The SDK Tooltip example (Telerik xaml-sdk-master\ChartView\WPF\Tooltip) works fine. But if I change the series from bar to line,
the tooltip will not show again.

Only change one line:
   <telerik:BarSeries CategoryBinding="Quarter" ValueBinding="Profit" />
to:
   <telerik:LineSeries CategoryBinding="Quarter" ValueBinding="Profit" />

So, how can I show simple tooltip on LineSeries or ScatterLineSeries? 

Thanks.
Martin Ivanov
Telerik team
 answered on 23 Nov 2018
5 answers
403 views

Currently, I'm trying to use Drag/Drop in my application however none of the events in relation to this are firing. Is this a known issue? If so, are there workarounds?

I've also tried to use ItemDoubleClick even which is also not getting fired. 

Please do let me know. 

TIA

Martin Ivanov
Telerik team
 answered on 23 Nov 2018
1 answer
177 views

I am going to use the footer to sum all values. 

<telerik:GridViewDataColumn.AggregateFunctions>
    <telerik:SumFunction ResultFormatString="{}{0:C2}"/>
</telerik:GridViewDataColumn.AggregateFunctions>

There are many columns, one of them I want to set the foreground color as Red.(Not all columns, just one important column)

First question: How to do it?

Second question: I saw the bottom border line of the footer is  gone. Why?

Thanks

Vladimir Stoyanov
Telerik team
 answered on 23 Nov 2018
2 answers
101 views

Hi everyone!

I use a Version 2015.1.401.40 GridView to show entries with a bool value. I want to show only entries with the bool value 'false', but keep the possibility to look at the other entries too.

So I created a Behavior for the GridView:

private RadGridView Grid
    {
      get => AssociatedObject as RadGridView;
    }
 
    protected override void OnAttached()
    {
      base.OnAttached();
      Grid.DistinctValuesLoading += Grid_DistinctValuesLoading;
      Grid.FilterOperatorsLoading += Grid_FilterOperatorsLoading;
    }
 
    private void Grid_DistinctValuesLoading(object sender, GridViewDistinctValuesLoadingEventArgs e)
    {
      e.ItemsSource = new List<bool>() { true, false };
    }
 
    private void Grid_FilterOperatorsLoading(object sender, FilterOperatorsLoadingEventArgs e)
    {
      IColumnFilterDescriptor okFilter = Grid.Columns["IsStandinSetupOK"].ColumnFilterDescriptor;
      okFilter.SuspendNotifications();
      okFilter.DistinctFilter.AddDistinctValue(false);
      okFilter.ResumeNotifications();
    }

 

And as expected only entries with the IsStandinSetupOK value 'false' are shown. But that filter is not indicated by the Icon, and the filter menu looks like there is no filter active (see screenshot). Even clicking 'Clear Filter' does nothing, to remove the filter I have to activate either the true or false filter first, THEN click 'Clear Filter'.

The GridView is filled with entries only after the filter was applied.

Any idea what I did wrong?

Best regards,

Stefan

Martin Ivanov
Telerik team
 answered on 23 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?