Dynamically created data to use within spreadsheet?

11 posts, 0 answers
  1. Richard
    Richard avatar
    11 posts
    Member since:
    Aug 2010

    Posted 21 Oct 2013 Link to this post

    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!
  2. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 24 Oct 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Jerry
    Jerry avatar
    6 posts
    Member since:
    Oct 2007

    Posted 24 Oct 2013 Link to this post

    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!
  5. Jerry
    Jerry avatar
    6 posts
    Member since:
    Oct 2007

    Posted 24 Oct 2013 Link to this post

    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!
  6. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 28 Oct 2013 Link to this post

    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 >>
  7. Richard
    Richard avatar
    11 posts
    Member since:
    Aug 2010

    Posted 07 Nov 2013 Link to this post

    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? 


  8. Jerry
    Jerry avatar
    6 posts
    Member since:
    Oct 2007

    Posted 08 Nov 2013 Link to this post

    Same problem for me, anyone have any thoughts?  Thank you!
  9. Jerry
    Jerry avatar
    6 posts
    Member since:
    Oct 2007

    Posted 10 Nov 2013 Link to this post

    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.
  10. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 11 Nov 2013 Link to this post

    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 >>
  11. Heiko
    Heiko avatar
    123 posts
    Member since:
    Oct 2012

    Posted 17 Oct 2014 in reply to Boryana Link to this post

    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
  12. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    103 posts

    Posted 17 Oct 2014 Link to this post

    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.

     
Back to Top
DevCraft banner