Walaa wrote:
I checked the helpdesk thread, and contrary to the code you have posted the following is the generated code for one of the field on related field properties:
public virtual System.String AitNmbr
{
get
{
AppAitEntity relatedEntity = this.AppAit;
if(relatedEntity!=null)
{
return relatedEntity.AitNmbr;
}
else
{
return (System.String)TypeDefaultValue.GetDefaultValue(typeof(System.String));
}
}
set
{
AppAitEntity relatedEntity = this.AppAit;
if(relatedEntity!=null)
{
relatedEntity.AitNmbr = value;
}
}
}
Which looks perfectly fine for me.
That's why I have to ask this again, did you pass a prefetchPath object to the LLBLGenProDataSource?
Which should do the trick and fetch the related object and hence populate the field mapped on it.
no I dont think did any prefetchpath to LLBLGenProDataSource. I just used the llbgenprodatasouce2 to the gridview as below
</llblgenpro:LLBLGenProDataSource2>
<llblgenpro:LLBLGenProDataSource2 ID="ODSInstance" runat="server" AdapterTypeName="ENVWeb.DAL.DatabaseSpecific.DataAccessAdapter, ENVWeb.DALDBSpecific" DataContainerType="EntityCollection" EntityFactoryTypeName="ENVWeb.DAL.FactoryClasses.VDbsBymachineEntityFactory, ENVWeb.DAL" >
<SelectParameters>
<asp:ControlParameter ControlID="GVMachineViewList" Name="MachineId" PropertyName="SelectedValue" Type="String"/>
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<asp:GridView ID="GVInstances" runat="server" DataSourceID="ODSInstance" AutoGenerateColumns="False"> <Columns>
<asp:TemplateField HeaderText="AIT Number">
<ItemTemplate>
<asp:TextBox ID="lblaitnmbr" runat="server" Text='<%# Bind("Aitnmbr") %>' Width="100px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Application Name">
<ItemTemplate>
<asp:TextBox ID="lblapplicationshortnm" runat="server" Text='<%# Bind("ApplicationShortNm") %>' Width="100px"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
where is the prefetch done?