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

Report Binding Question

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 26 Aug 2011, 01:19 AM
I'm trying to dynamically create a report through a view layout, which is a custom XML definition.

I want to give the report an object as it's data source and all my data is stored through a dictionary on the class that is accessible through an indexer that returns an object.  Something like below.  Can I set up my the report binding with something like textbox1.Value = "=Fields["PersonID"]"?  It doesn't seem to work this way and I'm confused how I would set up the binding here in this case.
public class Instance
{
     private Dictionary<string, object> dictionary = new Dictionary<string,object>();
      
     public object this[string s]
     {
         get { return dictionary[s]; }
         set { dictionary[s] = value; }
     }
}

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 30 Aug 2011, 06:12 PM
Hello Dave,

Report items can be bound only to data object's public properties. Binding to indexers is not supported.

Regards,
Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or