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

Dynamically created data to use within spreadsheet?

10 Answers 338 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 21 Oct 2013, 09:33 PM
The output that I require within my Silverlight project 'looks' like a spreadsheet (a profit/loss spreadsheet), but the data doesn't exist anywhere except a database.  Can I use the radSpreadsheet, and dynamically add cell data, etc.?  Does anyone have any examples of this usage?  Or, am I going about this wrong, and this might not be the control that's best for what I need?  All examples appear to have an excel document as their source, but I won't have this.  Any help is appreciated.  Thanks!

10 Answers, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 24 Oct 2013, 01:32 PM
Hi Richard,

Thank you for writing.

Most RadSpreadsheet examples import a document because this is a popular scenario. However, the document model of the control allows you to build a document from scratch. All you need to do is set the values you get from the database to the appropriate cells. Attached is a very simple project that demonstrates how to access and set the values of cells. I hope you will find it useful.

Please note that our Silverlight suite contains two grid-like controls: RadSpreadsheet and RadGridView. They seem alike at first sight, however, they are semantically different. Unlike RadGridView, RadSpreadsheet is not intended to support bound scenarios. While RadGridView is designed to present bound data, RadSpreadsheet is dedicated to creation and manipulation of documents.

In this sense, you can pull data from your database and present it in RadSpreadsheet, however, changing the data in the control will not update automatically your data base. If you expect such an update to be performed, RadGridView will be a better choice for your requirements.

I hope you will find the sample project and the information about RadGridView and RadSpreadsheet helpful. Feel free to write back if you have further queries on the topic. I will do my best to assist you.

Regards,
Boryana
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Jerry
Top achievements
Rank 2
answered on 24 Oct 2013, 03:59 PM
Thanks for your sample project, I'll definitely take a look.

I use the RadGridView all the time, but the issue is that our users want a pretty, formatted output.  The only output format available from the RadGridView is .csv and that doesnt' support any formatting.  My assumption with using the RadSpreadsheet is that I could both format the dynamic data onto the screen (it's all read only anyway), and then export/save it as an .xlsx document and retain that formatting.  In addition, having access to formulas, etc. would also save me some time by handling the calculations for me. 

With what I've described, can you see a better way to do this besides with RadSpreadsheet?  Thanks again!
0
Jerry
Top achievements
Rank 2
answered on 24 Oct 2013, 08:38 PM
Any chance to get an MVVM type example?  I'm trying to make that work, but I'm not sure what I'd bind to for the spreadsheet's data.  Perhaps a workbook?  And create a worksheet, add what I need, associate that to the workbook?  That makes intuitive sense here, but I'm not sure how to make that actually work in the real world.  Thanks for your help!
0
Boryana
Telerik team
answered on 28 Oct 2013, 03:14 PM
Hi Jerry,

Attached is a modified version of the sample project that demonstrates how to use RadSpreadsheet in an MVVM scenario. Basically, you need to add an attached property of type Workbook to the RadSpreadsheet class and bind it to the workbook in your view model. Please note that such setup is appropriate only for the cases you present read-only data to the users and do not update the presented records frequently.

I hope you will find it useful. Feel free to write back if you have further queries on the topic. 

Regards,
Boryana
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Richard
Top achievements
Rank 1
answered on 07 Nov 2013, 10:42 PM
Okay, so I've looked at the MVVM example.  At this point I've upgraded from 2012 Q2 to the 2013 Q3.  Older control versions have been replaced with the new ones and my project builds and runs as expected.  Now, it's time to get the spreadsheet in there and running.

At this point I get the following error:
XAML image of spreadsheet control says Cannot create an instance of RadSpreadhsheet.
In the XAML code hovering over the control declaration I see this: Method not found:  'Void Telerik.Windows.Documents.Spreadsheet.Utilities.InputBindingCollectionExtensions.RegisterCommandOrShiftOrAlt

I need to use images as I'm moving things back and forth between 2 computers.  From one I can't get to this website, I have no idea why not.

Attached are my references, including the System.Windows.Controls.dll from the SDK.
Attached is a picture of my xaml, using the MVVM example that was attached.
I have a class called SpreadsheetAttachedProperties just like the example.  

I can't get this to work, and I'm not really sure where to go from here.  Any thoughts? 


0
Jerry
Top achievements
Rank 2
answered on 08 Nov 2013, 09:03 PM
Same problem for me, anyone have any thoughts?  Thank you!
0
Jerry
Top achievements
Rank 2
answered on 11 Nov 2013, 02:38 AM
No one has any thoughts or suggestions on how to fix this issue or where this error is coming from?  Do I need to include more code or something?  You're usually very good about offering assistance, but nothing for days.  Google searches return nothing about this error and this control is new enough to not have many people using it to offer suggestions.  Please help.
0
Boryana
Telerik team
answered on 11 Nov 2013, 09:18 AM
Hello,

Thank you for writing.

We are not able to reproduce the issue you describe. In this case I kindly ask both of you to open a support ticket and attach a project that illustrates the problem. Also, would you please let me know whether you are able to run the sample project attached to my previous post or the issue appears there as well? Once we are able to replicate the issue, we will do our best to provide you with proper support.

I am looking forward to your projects.

Regards,
Boryana
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Heiko
Top achievements
Rank 1
answered on 17 Oct 2014, 06:52 AM
Just one question on the topic "MVVM". The RadSpreadsheet Control has a Workbook property. Why can't I simply bind this to a property of my ViewModel, and why do I have to create an attached property in order to load a workbook via MVVM?

Regards
Neils
0
Nikolay Demirev
Telerik team
answered on 17 Oct 2014, 09:53 AM
Hi Neils,

Currently the Workbook property of the RadSpreadsheet is Dependency property, so you can bind it to a property of your ViewModel.

Regards,
Nikolay Demirev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Spreadsheet
Asked by
Richard
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Jerry
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Heiko
Top achievements
Rank 1
Nikolay Demirev
Telerik team
Share this question
or