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

Telerik Reporting Table

1 Answer 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lonnie
Top achievements
Rank 2
Lonnie asked on 07 Apr 2011, 04:25 AM
I'm looking for an example of how to bind a char to a generic list of first names and last names. My list looks like the following:
public class Names
{
    public string FirstName;
    public string LastName;
}

After gathering my data I create a list of Names
List<Names>ABunchOfNames = new List<Names>();

My list is populated, I see all of the names in the list...

I then set the datasource of the table to the List:
myTable.Datasource = ABunchOfNames;

When I look at the datasource during debug, I can see that my list is in there...  When I let the report finish I get the following errors:
"An error has occurred while processing Textbox 'textbox19': The expression contains object 'FirstName' that is not defined in the current context.

I get the same thing for LastName...

I am using Q2 2009 Telerik reporting due to the hoops I have to jump through to make the slightest of changes of architecture...  Any help? 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Lonnie
Top achievements
Rank 2
answered on 07 Apr 2011, 06:40 PM
I figured out the problem.  The issue was how the class was defined using variables rather than gets and sets.
This:
public class Names
{
    public string FirstName;
    public string LastName;
}

Should have been this:
public class Names
{
    public string FirstName {get;set;}
    public string LastName {get;set;}
}
Tags
General Discussions
Asked by
Lonnie
Top achievements
Rank 2
Answers by
Lonnie
Top achievements
Rank 2
Share this question
or