RadGrid with ClientDataSource not show NestedViewTemplate

2 posts, 0 answers
  1. Rogelio
    Rogelio avatar
    5 posts
    Member since:
    Oct 2012

    Posted 11 Jun 2015 Link to this post

    I have a radgrid associated to a ClientDataSource, inside the RadGrid there is a NestedViewTemplate but i can not make it work. If i change the ClientDataSource for a SqlDataSource it works perfectly:

    <telerik:RadGrid 
    ID="gvDetalleFactura" 
    runat="server" 
    AllowSorting="True" 
    AutoGenerateColumns="False" 
    DataSourceID="SqlDSFacturaDetalle" 
    Width="917px" 
    >
    <ItemStyle CssClass="GridView-ItemStyle" />
    <AlternatingItemStyle CssClass="GridView-ItemStyle" />
    <HeaderStyle CssClass="GridView-HeaderStyle" />
    <HierarchySettings CollapseTooltip="Ocultar Datos..." ExpandTooltip="Mostrar Datos..." />

    <MasterTableView 
    HierarchyLoadMode="Client"
    >
           <ExpandCollapseColumn 
                                            Visible="true" 
                                            ButtonType="ImageButton"
                                            ExpandImageUrl="Images/expand_blue.ico"
                                            CollapseImageUrl="Images/collapse_blue.ico" 
                                            Display="true" 
                                        ></ExpandCollapseColumn>

    <NestedViewTemplate>
    <asp:Table ID="tblComentarios" runat="server" Width="100%">
    <asp:TableRow>
    <asp:TableCell Width="20%">
    <asp:Label ID="lblComentariosSolicitante" runat="server" Text="Comentarios Solicitante:"></asp:Label>
    </asp:TableCell>
    <asp:TableCell Width="80%">
    <telerik:RadTextBox ID="txtComentariosSolicitante" runat="server" 
    InvalidStyleDuration="100" 
    TextMode="MultiLine"
    Width="700px"
    >
    <hoveredstyle bordercolor="DeepSkyBlue" />
    <focusedstyle bordercolor="DeepSkyBlue" backcolor="AliceBlue" />
    </telerik:RadTextBox>
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>
    </NestedViewTemplate>

    <Columns>
    <telerik:GridTemplateColumn HeaderText="Posicion" SortExpression="Posicion" ColumnGroupName="DetalleFactura">
    <ItemTemplate>
    <asp:Label ID="lblPosicion" runat="server" Text='<%# Bind("Posicion") %>'></asp:Label>
    </ItemTemplate>
    </telerik:GridTemplateColumn>

    <telerik:GridTemplateColumn HeaderText="Material" SortExpression="Material" ColumnGroupName="DetalleFactura" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px">
    <ItemStyle Width="50px" />
    <ItemTemplate>
    <asp:Label ID="lblMaterial" runat="server" Text='<%# Bind("CodigoCorto") %>'></asp:Label>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
    </Columns>

    <ColumnGroups>
    <telerik:GridColumnGroup HeaderText="Detalle Factura" Name="DetalleFactura" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" ></telerik:GridColumnGroup>
    </ColumnGroups>
    </MasterTableView>
    </telerik:RadGrid>



    <asp:SqlDataSource 
    ID="SqlDSFacturaDetalle"
    runat="server"
    ConnectionString="<%$ ConnectionStrings:SAIS %>"
    SelectCommand="[SNCGetFacturaDetalle]"
    SelectCommandType="StoredProcedure"
    >
    <SelectParameters>
    <asp:Parameter Name="vFactura" Type="Int32" DefaultValue="920999251" />
    </SelectParameters>
    </asp:SqlDataSource>

     

     Last code works perfectly, but if change for ClientDataSource after:

                       var resultFacturaDetalle = GetSynchronousJSONResponse('Service1.asmx/GetFacturaDetalle', '{"Factura": "' + Factura + '"}');
                       var masterTable = $find(rgFacturaDetallesID).get_masterTableView();
                       masterTable.set_dataSource(eval('(' + resultFacturaDetalle + ').d'));
                       masterTable.dataBind();

     

    NestedViewTemplate does not show at all.

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 16 Jun 2015 Link to this post

    Hi Rogelio,

    As documented in our help article "RadGrid - Known Limitations", Client-side Binding does not support hierarchical structure, so if you need to have NestedViewTemplate you will have to use Server-side Binding instead.


    Best Regards,
    Konstantin Dikov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top