Telerik Forums
UI for WPF Forum
10 answers
281 views

     Struggling to mimic the Grid View Exporting to Xlsx and Pdf example in the DEMO to understand how to build this function in a project. For the most part I have created the a working code but two things happens.

1) I get zero bit excel file.

2) In the code get System.ArgumentException "Please provide GridViewDataControl for exporting!". Sure enough in "var grid = param as RadGridView;" Param looks good bu the "grid" is null. Not sure how to over come.

When I run the demo program for the first time and open the xlsx file I'm getting something about the formatting is not correct... 

 
private void Export(object param)
        {
            var grid = param as RadGridView;
            var dialog = new SaveFileDialog()
            {
                DefaultExt = this.SelectedExportFormat,
                Filter = String.Format("(*.{0})|*.{1}", this.SelectedExportFormat, this.SelectedExportFormat)
            };
 
            if (dialog.ShowDialog() == true)
            {
                using (var stream = dialog.OpenFile())
                {
                    switch (this.SelectedExportFormat)
                    {
                        case "xlsx":
                            grid.ExportToXlsx(stream);
                            break;
                        case "pdf":
                            //grid.ExportToPdf(stream);
                            break;
                    }
                }
            }
        }
::
private void ExportDefaultStyles(object param)
        //private void ExportDefaultStyles(RadGridView param)
        {
            var grid = param as RadGridView;
            var exportOptions = new GridViewDocumentExportOptions()
            {
                ExportDefaultStyles = true,
                ShowColumnFooters = grid.ShowColumnFooters,
                ShowColumnHeaders = grid.ShowColumnHeaders,
                ShowGroupFooters = grid.ShowGroupFooters
            };
 
            var dialog = new SaveFileDialog()
            {
                DefaultExt = this.SelectedExportFormat,
                Filter = String.Format("(*.{0})|*.{1}", this.SelectedExportFormat, this.SelectedExportFormat)
            };
 
            if (dialog.ShowDialog() == true)
            {
                using (var stream = dialog.OpenFile())
                {
                    switch (this.SelectedExportFormat)
                    {
                        case "xlsx":
                            grid.ExportToXlsx(stream, exportOptions);
                            break;
                        case "pdf":
                            grid.ExportToPdf(stream, exportOptions);
                            break;
                    }
                }
            }
        }

In both methods I'm not correctly figuring out how to set the "grid" correctly so it can be passed down. It works this way in your demo.

Is there any way to download the demo to work on it locally?

Dilyan Traykov
Telerik team
 answered on 02 Dec 2020
1 answer
115 views
Hello,

We try to use PDFViewer for fillable Acroforms.

The behaviour of the textfields in PDF-Viewer, is not as we would prefer.

* First mouse-click to an editable Textfield:
 -> previous Textfield loses focus

* Second mouse-click (to the same editable Textfield):
 -> new Textfield gets focus, but is not in Edit-Mode

* Third Mouse-Click   
 -> new Textfield has focus and is editable

When moving to the next textfield, again at least 3 Clicks are required.

Is there any way to customize or override this behaviour?

We would like to have it single click (like in acrobat or edge).


Thanks,

Martin
Dimitar
Telerik team
 answered on 02 Dec 2020
3 answers
155 views

Hi. I am looking at using your SyntaxEditor control and had a few questions before I dive into this. I have read all forum items and all documentation. I am pretty sure your control supports these questions, but I want to double check.

I have a custom language where I would need dynamic Inteliprompt lists to be displayed. For instance, if I have a variable and I press a period. I would like different lists to be displayed based on datatype (which I would parse out ahead of time). Is this dynamic functionality available?

Next, at times I need the control to be read-only. Is this available?

Next, while the control is read-only, can I dynamically highlight a single row and change this highlighted row as needed via your API?

Lastly, are the language element tooltips dynamic? Is there an event that fires or something I may intercept to set the tooltip for a language element (i.e. a variable) before it is displayed? (I assume your tooltips use your tooltip control.)

Thank you for your time. 

Dilyan Traykov
Telerik team
 answered on 01 Dec 2020
5 answers
153 views

Hello,

Help me to perform sorting on telerik gantt view columns

Dilyan Traykov
Telerik team
 answered on 01 Dec 2020
1 answer
1.1K+ views

I'm looking for a quick way to enabled/disable tooltips application wide (globally).  I realize I can do the following on EVERY single control:

RadToolTipService.SetIsEnabled(Me.bnSettings, False)

 

repeat for each control in my application, however, I was hoping there was an easy way to enable/disable all tooltips in my application?

 

Cheers, Rob.

Martin Ivanov
Telerik team
 answered on 01 Dec 2020
3 answers
273 views
Hello, how can horizontal axis items always contain 5 values of time? Now, as new data arrives, new values are constantly added to the horizontal axis, and the graph is compressed to the left corner.I use Cartesian Linear chart with 5 series bind to model class.
Dinko | Tech Support Engineer
Telerik team
 answered on 01 Dec 2020
4 answers
182 views

Hi there,

I am trying to make an offline world map using the RadMap control. I am using shapefiles (.shp and .dbf) such as done in the ShapefileMapShapeReader example in the SDK. However, this is done targeting .NET Framework v4.0, whereas I'd like to attempt this targeting .NET 5. What I did was: Update to the latest version of the Telerik UI for WPF, including the Visual Studio 2019 plugins. I made a new Telerik WPF application (targeting .NET 5) and copied the contents from the SDK example (the MainWindow.xaml contents and the world.shp and world.dbf files, set the latter two to have Build Action "Resource"). However, this does not display the map as it does in the example.

Now I tried the exact same steps as described above, but now for a Telerik WPF application targeting .NET Framework v4.0 (and hence making my own ShapefileMapShapeReader example). This does work properly. Can you give me any pointers on if you experience the same and if there are possibilities to fix this issue? Or, if you're reading this and have a better idea about showing offline coastal lines in the RadMap control, I'm open to that too. :-)

Kind regards,

Tom

See http://www.tomjoosten.nl/TelerikWpfMap.zip

Vladimir Stoyanov
Telerik team
 answered on 30 Nov 2020
3 answers
215 views

Hey

I'm trying to configure a TreeListView to select the full row of childless rows when I use the arrow keys for navigation, curiously I checked the demo and it has the behaviour I'm trying to achieve! However I have looked at the demo code and can't spot how it's achieving it, which makes me think it's the default behaviour?

When I use the arrow keys on our TreeListView, it selects the cell of childless nodes rather than the whole row, see attached gif

Many thanks

Dilyan Traykov
Telerik team
 answered on 30 Nov 2020
4 answers
185 views

I was wondering if it's possible to cycle thru "available" themes programmatically when using XAML/StyleManager approach?  I'd like to cycle thru whatever themes are supported in the XAML approach and display their names in a ComboBox for a user to select.

Cheers, Rob.

 

Martin Ivanov
Telerik team
 answered on 30 Nov 2020
1 answer
241 views

Hi

I've a question: I would like to create a live chart view (with measurment points, updated every second) combining 2 styles:

- A simple threshold bar

- A gradient mountain style (gradient could be fix from min to max of the y axis)

Is this possible with Telerik chartviews (how), or do I have to use some other chart packages like scichart?

I've attached an example, what I want do create...

best regards

Patrick

Martin Ivanov
Telerik team
 answered on 30 Nov 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?