A
AV
I am trying to bind a arraylist with custom Employee
objects to a datagrid. I was debugging this code and
found that the arraylist is populated with 45 Employee
objects.....
Then I do this in the code behind :
// Binding datasource
dgEmployeeList.DataSource = arrEmployeeList;
dgEmployeeList.DataBind();
Here's the HTML view :
<Columns>
<asp:BoundColumn DataField='<%# DataBinder.Eval
(Container.DataItem, "EmployeeID")%>'
HeaderText="EmployeeID">
</asp:BoundColumn>
</Columns>
When the page is run, I get the following error message.
"A field or property with the name '"<%# Databinder.Eval
(Container.DataItem, "EmployeeID" %>"' was not found on
the selected datasource. "
Although in debug mode I successfully retrieved the value
for the EmployeeID from the objects in the arraylist.
I just don't know where am I going wrong
Any help will be highly appreciated.
Thanks
objects to a datagrid. I was debugging this code and
found that the arraylist is populated with 45 Employee
objects.....
Then I do this in the code behind :
// Binding datasource
dgEmployeeList.DataSource = arrEmployeeList;
dgEmployeeList.DataBind();
Here's the HTML view :
<Columns>
<asp:BoundColumn DataField='<%# DataBinder.Eval
(Container.DataItem, "EmployeeID")%>'
HeaderText="EmployeeID">
</asp:BoundColumn>
</Columns>
When the page is run, I get the following error message.
"A field or property with the name '"<%# Databinder.Eval
(Container.DataItem, "EmployeeID" %>"' was not found on
the selected datasource. "
Although in debug mode I successfully retrieved the value
for the EmployeeID from the objects in the arraylist.
I just don't know where am I going wrong
Any help will be highly appreciated.
Thanks