This is a migrated thread and some comments may be shown as answers.

How to export GridView to Excel in MVVM ?

7 Answers 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 21 Jan 2011, 11:19 AM
Hello,

I my project, i have to export the GridView to Excel format but my project is in MVVM (MVVM Light Toolkit).
Can you provide me a way to achieve that ?

Best regards,
Guillaume

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Jan 2011, 12:42 PM
Hello,

 If you want to export using MVVM pattern and practices you may need to create custom attached behavior. You can check for example this demo to know more how to create custom attached behavior.

All the best,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Guillaume
Top achievements
Rank 1
answered on 26 Jan 2011, 02:22 PM
Thanks for your help.
In fact, i want to export my page in png (via WriteableBitmap) but i don't know where put my attached behavior.
On click of my button "Export" who will set a property in my ViewModel ?

Can you help me ?
Guillaume
0
Guillaume
Top achievements
Rank 1
answered on 01 Feb 2011, 05:51 PM
Thanks. That worked.
0
Igor Ashmetkov
Top achievements
Rank 1
answered on 09 Sep 2011, 02:42 PM
Hello,
I check demo, but it`s still not clear for me. I have the same question, "On click of my button "Export" who will set a property in my ViewModel?"
Can you show example please? 
0
Vlad
Telerik team
answered on 13 Sep 2011, 07:45 AM
Hello Igor,

 The idea is to get reference to RadGridView in reusable way - attached behavior. When you have the reference you can use the grid Export() method, Items collection, etc. 

Best wishes,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
ahps
Top achievements
Rank 1
answered on 28 Mar 2017, 12:46 AM
I know this is an old post, but are you able to provide the example again?   unable to open that link.
0
Dilyan Traykov
Telerik team
answered on 30 Mar 2017, 02:28 PM
Hello,

The example my colleague referenced just shows an implementation of an attached behavior. You can have a look at the Attached Behavior article if you're uncertain how to create one.

Additionally, please have a look at the Export demos available in the Silverlight Controls Examples and SDK Examples Browser as they can give you a good idea of how to implement this functionality in your own project.

I hope you find these resources helpful. If you need any further assistance, please let me know.

Regards,
Dilyan Traykov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Guillaume
Top achievements
Rank 1
Igor Ashmetkov
Top achievements
Rank 1
ahps
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or