Hi,
I have a telerik project with Entity Framework.
I want to show de value of the related tables in a GridBoundColumn, but ever come empty.
I Attach a picture showing the related tables, and the code in the aspx.
Please , someone can help me? Thanks
Code in ASPX
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
AllowPaging="True" PageSize="50" AllowSorting="True" AutoGenerateColumns="False"
ShowStatusBar="true" AllowFilteringByColumn="True"
DataSourceID="EntityDataSourceUsuarios" OnDeleteCommand="RadGrid1_RowDeleting" OnItemDeleted="RadGrid1_ItemDeleted"
OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="true" >
<MasterTableView DataSourceID="EntityDataSourceUsuarios" AutoGenerateColumns="False"
DataKeyNames="ID" CommandItemDisplay="Top" PageSize="50">
Columns…..
<telerik:GridBoundColumn DataField="M_EMPRESAS.Descripcion" HeaderText="Empresa" SortExpression="M_EMPRESAS.Descripcion" UniqueName="M_EMPRESAS.Descripcion" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="M_TARIFAS.ID" HeaderText="Tarifa" SortExpression="M_TARIFAS.ID" UniqueName="M_TARIFAS.ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="M_TIPO_ACCESO_TARJETA.ID" DataType="System.Int32" HeaderText="Acceso" SortExpression="M_TIPO_ACCESO_TARJETA.ID" UniqueName="M_TIPO_ACCESO_TARJETA.ID" >
</telerik:GridBoundColumn>
Entitys…..
<asp:EntityDataSource ID="EntityDataSourceUsuarios" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_USUARIO" OrderBy="it.[CodEmpleado]"
EntityTypeFilter="M_USUARIO" EnableUpdate="True" EnableDelete="True" EnableInsert="True" ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceAccesoTarjeta" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_TIPO_ACCESO_TARJETA" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceEmpresa" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_EMPRESAS" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceTarifa" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_TARIFAS" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
I have a telerik project with Entity Framework.
I want to show de value of the related tables in a GridBoundColumn, but ever come empty.
I Attach a picture showing the related tables, and the code in the aspx.
Please , someone can help me? Thanks
Code in ASPX
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
AllowPaging="True" PageSize="50" AllowSorting="True" AutoGenerateColumns="False"
ShowStatusBar="true" AllowFilteringByColumn="True"
DataSourceID="EntityDataSourceUsuarios" OnDeleteCommand="RadGrid1_RowDeleting" OnItemDeleted="RadGrid1_ItemDeleted"
OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="true" >
<MasterTableView DataSourceID="EntityDataSourceUsuarios" AutoGenerateColumns="False"
DataKeyNames="ID" CommandItemDisplay="Top" PageSize="50">
Columns…..
<telerik:GridBoundColumn DataField="M_EMPRESAS.Descripcion" HeaderText="Empresa" SortExpression="M_EMPRESAS.Descripcion" UniqueName="M_EMPRESAS.Descripcion" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="M_TARIFAS.ID" HeaderText="Tarifa" SortExpression="M_TARIFAS.ID" UniqueName="M_TARIFAS.ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="M_TIPO_ACCESO_TARJETA.ID" DataType="System.Int32" HeaderText="Acceso" SortExpression="M_TIPO_ACCESO_TARJETA.ID" UniqueName="M_TIPO_ACCESO_TARJETA.ID" >
</telerik:GridBoundColumn>
Entitys…..
<asp:EntityDataSource ID="EntityDataSourceUsuarios" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_USUARIO" OrderBy="it.[CodEmpleado]"
EntityTypeFilter="M_USUARIO" EnableUpdate="True" EnableDelete="True" EnableInsert="True" ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceAccesoTarjeta" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_TIPO_ACCESO_TARJETA" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceEmpresa" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_EMPRESAS" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceTarifa" runat="server"
DefaultContainerName="HARVESTEntities" EntitySetName="M_TARIFAS" OrderBy="it.[ID]"
ConnectionString="name=HARVESTEntities">
</asp:EntityDataSource>