Using: .NET 2, LLBLGen v2.5, SQL Server 2005, Self-Servicing
Hi,
I have bound a GridView to a TypedList (which is based on 4 different entities) but I receive an error when defining the 'DataKeyNames' for the GridView. The error is:
"DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'UserName'"
The problem is the DataKeyName has to be a primary key but I don't know how this works when using a TypedList that is based on several entities? - It doesn't seem possible to define a primary key for the TypedList (if this is the solution)
--aspx page--
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="PermissionsDataSource" AllowPaging="True" AllowSorting="True" DataKeyNames="Status">
<Columns>
<asp:BoundField DataField="UserName" HeaderText="Requestor" InsertVisible="False" ReadOnly="True" SortExpression="UserName" />
</Columns>
</asp:GridView>
<llblgenpro:LLBLGenProDataSource ID="PermissionsDataSource" runat="server" DataContainerType="TypedList" TypedListTypeName="work.ODS.TypedListClasses.TicketGridTypedList, work.ODS" livepersistence="False" OnPerformSelect="ticketDS_PerformSelect">
</llblgenpro:LLBLGenProDataSource>
--code-behind--
protected void ticketDS_PerformSelect(object sender, PerformSelectEventArgs e)
{
e.ContainedTypedList.Fill();
}
Any help would be appreciated.