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

How do I turn this hierarchy with template into programmatic bindingv

3 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
G
Top achievements
Rank 1
G asked on 13 Apr 2013, 06:17 PM

this attached example (including radchart, multipage, pageviews) is decent but i found slow loading if the record amount is huge. i d like to modify it like programmatic binding with radGrid fires the DetailTableDataBind event. how can it do? can you show me the example?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Apr 2013, 04:52 AM
Hi,

You can bind the Detailtable in DetailTableDataBind event as explained in the following demo.
Grid - Programmatic Binding

Thanks,
Shinu
0
G
Top achievements
Rank 1
answered on 15 Apr 2013, 06:50 AM
Hi, 

Thanks for your reply.

The following is my code but the radtapStrip but cannot work. it seems detailtables cannot contain RadTab and Panel as item. do you have any idea?

G

<
telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="True" AutoGenerateColumns="False"
        PageSize="50" AllowSorting="True" AllowPaging="True" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
        OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" CellSpacing="0"
        Width="800px" GridLines="None">
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <ClientSettings>
            <Resizing AllowColumnResize="True" AllowResizeToFit="True" />
        </ClientSettings>
        <MasterTableView Name="level1" AllowMultiColumnSorting="True" DataKeyNames="barDate">
            <Columns>
                <telerik:GridBoundColumn SortExpression="barDate" HeaderText="barDate" DataField="barDate"
                    UniqueName="barDate" DataType="System.DateTime" FilterControlAltText="Filter barDate column"
                    ReadOnly="True" DataFormatString="{0:MM/dd/yyyy}">
                    <HeaderStyle Width="80px"></HeaderStyle>
                    <ItemStyle Width="80px"></ItemStyle>
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="TemplateColumn">
                </telerik:GridTemplateColumn>
            </Columns>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <DetailTables>
                <telerik:GridTableView Name="IntradayDetail">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="barDate" MasterKeyField="barDate" />
                </ParentTableRelation>
                <NestedViewTemplate>
                    <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                        <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab runat="server" Text="IntradaySummary" PageViewID="PageView1">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                            <telerik:RadPageView runat="server" ID="PageView1">
                                <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("barDate") %>'
                                    Visible="false" runat="server" />
                                <telerik:RadGrid runat="server" ID="FactorGrid" ShowFooter="true" OnNeedDataSource="FactorGrid__OnNeedDataSource"
                                    AllowSorting="true" EnableLinqExpressions="false" OnPreRender="FactorGrid_OnPreRender">
                                    <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                        DataKeyNames="barDate" PageSize="40" HierarchyLoadMode="ServerOnDemand">
                                        <SelfHierarchySettings ParentKeyName="barDate" KeyName="barDate" />
                                        <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column" visible="True">
                                        </rowindicatorcolumn>
                                        <columns>
                                            <telerik:GridBoundColumn DataField="factor" DataType="System.Int32" FilterControlAltText="Filter factor column"
                                            HeaderText="factor" UniqueName="factor">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="TemplateColumn">
                                            </telerik:GridTemplateColumn>
                                        </columns>
                                        <editformsettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </editformsettings>
                                        </MasterTableView>
                                        </telerik:RadGrid>
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </asp:Panel>
                </NestedViewTemplate>
                </telerik:GridTableView>
            </DetailTables>
             
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
             
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
0
Shinu
Top achievements
Rank 2
answered on 29 Oct 2013, 07:05 AM
Hi ,

You can have a radgrid with NestedViewTemplate,rather than having it in DetailTables.Inside the NestedViewTemplate,you can have your panel and RadTabStrip along with RadGrid and the DetailTable.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" . . . >
    . . .
    <MasterTableView DataKeyNames="barDate">
        <Columns>
            . . .
        </Columns>
        <NestedViewTemplate>
            <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="IntradaySummary" PageViewID="PageView1">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                    <telerik:RadPageView runat="server" ID="PageView1">
                        <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("barDate") %>'
                            Visible="false" runat="server" />
                        <telerik:RadGrid runat="server" ID="FactorGrid" . . .>
                            <MasterTableView . .>
                                <SelfHierarchySettings ParentKeyName="barDate" KeyName="barDate" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                </RowIndicatorColumn>
                                <Columns>
                                    . . .
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </asp:Panel>
        </NestedViewTemplate>
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
        </ExpandCollapseColumn>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>

Thanks,
Shinu
Tags
Grid
Asked by
G
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
G
Top achievements
Rank 1
Share this question
or