ExportToExcelML and custom object

4 posts, 0 answers
  1. Nino
    Nino avatar
    9 posts
    Member since:
    Apr 2013

    Posted 09 May 2013 Link to this post

    Good morning,

    after binding a collection (List) of custom object to a gridview (with no problem) i am using ExportToExcelML to export that grid in excel;

    it does export only object's property of a "know" type..

    Example 

    class Car
    {
    public string Name ;
    }


    Class Customer
    {
    public string Name;
    public Car Car{get;protected set;}
    }

    binding radgridview with a List<Customer> and exporting to excel will export just "Name" property and not "Car" , when in the gridview is shown correctly.
     is there any interface i need to implement in my classes? 

    Thanks 

    Nino
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 14 May 2013 Link to this post

    Hello Nino,

    Thank you for writing.

    Could you please provide me with the code you used to populate the list and bind the grid to this list. You have a protected setter of the Car property and I am not sure how you populate the List in this case.

    Once I am able to populate the grid as on your side, I will investigate the exporting issue you experience.

    I am looking forward to your reply.
     

    All the best,
    Stefan
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
  3. Nino
    Nino avatar
    9 posts
    Member since:
    Apr 2013

    Posted 23 May 2013 Link to this post

    Hi Stefan,

    i solved it binding the gridcolumn to the Car.Name property.

    Doing this it export correctly in excel...i just meant the IML were using the toString method as the grid does.


    Thanks
  4. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 28 May 2013 Link to this post

    Hello,

    I am glad you have sorted this out. Should you have any other questions, do not hesitate to contact us.
     
    Regards,
    Stefan
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top