This is a migrated thread and some comments may be shown as answers.

RadGrid with ClientDataSource not show NestedViewTemplate

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rogelio
Top achievements
Rank 1
Rogelio asked on 11 Jun 2015, 04:20 PM

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.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 16 Jun 2015, 10:00 AM
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
Tags
Grid
Asked by
Rogelio
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or