无法崩溃asp.net ajax Telerik gridtableview

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法崩溃asp.net ajax Telerik gridtableview相关的知识,希望对你有一定的参考价值。

在telerik中加载数据和扩展gridtableview正在工作,但是当试图崩溃时,它无法正常工作。只有当我展开网格中的另一行时,崩溃才有效。为什么切换扩展和崩溃不起作用?是对telerik功能提出质疑还是内部错误?

更新:代码

               <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Windows7"  AutoGenerateColumns="false"  OnItemDataBound="Radgrid1_OnItemDataBound" AllowFilteringByColumn="false"
                      GridLines="None" BorderWidth="1px" CellPadding="0" EnableViewState="true"  OnPreRender="RadGrid1_PreRender" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
                    Height="625px" Width="100%" AllowSorting="true" PageSize="50" AllowPaging="true" OnCustomAggregate="RadGrid1_CustomAggregate"
                     OnExcelExportCellFormatting="exporter_ExcelCellFormatting">
                    <GroupingSettings CaseSensitive="false" />
                    <MasterTableView EditMode="Batch" CommandItemDisplay="Top" AllowFilteringByColumn="true" AllowMultiColumnSorting="false" OverrideDataSourceControlSorting="true"
                        Width="100%" UseAllDataFields="false" ShowFooter="true" FooterStyle-HorizontalAlign="Right" AllowCustomSorting="true" AutoGenerateColumns="false"
                        NoMasterRecordsText="No Records Display" HierarchyLoadMode="ServerOnDemand" DataKeyNames="Sales RepNo" Name="SalesRepGrid" HierarchyDefaultExpanded="false" PageSize="20">
                        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" ShowExportToExcelButton="true" ShowSaveChangesButton="false" ShowCancelChangesButton="false"/>


                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="Sales RepNo" SortOrder="Ascending" />
                        </SortExpressions>



                        <ColumnGroups>                                                        
                        <telerik:GridColumnGroup Name="Cases" HeaderText="Cases" HeaderStyle-HorizontalAlign="Center" />
                        <telerik:GridColumnGroup Name="Revenue" HeaderText="Revenue" HeaderStyle-HorizontalAlign="Center" />
                        </ColumnGroups>


                        <DetailTables>
                        <telerik:GridTableView Name="CustomerReportGrid" runat="server" PageSize="10"><ColumnGroups>
                        <telerik:GridColumnGroup Name="CustomerNo" HeaderText="Customer No" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"/>
                        <telerik:GridColumnGroup Name="CustomerName" HeaderText="Customer Name" HeaderStyle-HorizontalAlign="Center" />
                        <telerik:GridColumnGroup Name="InvoiceDate" HeaderText="Last Purchase Date" HeaderStyle-HorizontalAlign="Center" />                            
                        <telerik:GridColumnGroup Name="Cases" HeaderText="Cases" HeaderStyle-HorizontalAlign="Center" />                            
                        <telerik:GridColumnGroup Name="Revenue" HeaderText="Revenue" HeaderStyle-HorizontalAlign="Center" />
                        </ColumnGroups>


                            <Columns>
                                <telerik:GridBoundColumn DataField="CustomerNo" UniqueName="CustomerNo" HeaderText="" ColumnGroupName="CustomerNo">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CustomerName" UniqueName="CustomerName" HeaderText=""  ColumnGroupName="CustomerName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="InvoiceDate" UniqueName="InvoiceDate" HeaderText=""   ColumnGroupName="InvoiceDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CM_cases" UniqueName="CM_cases" HeaderText="CM"   ColumnGroupName="Cases" ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LM_cases" UniqueName="LM_cases" HeaderText="CM PY"   ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CM_LM_VAR" UniqueName="CM_LM_VAR" HeaderText="VAR"   ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="YTD" UniqueName="YTD" HeaderText="YTD"   ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PYTD" UniqueName="PYTD" HeaderText="PYTD"   ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right">
                                    </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="YTD_PYTD_VAR" UniqueName="YTD_PYTD_VAR" HeaderText="YTD_PYTD_VAR"   ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CM_Rev" UniqueName="CM_Rev" HeaderText="CM"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LM_Rev" UniqueName="LM_Rev" HeaderText="CM PY"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CMRev_LMRev_VAR" UniqueName="CMRev_LMRev_VAR" HeaderText="VAR"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="YTD_Rev" UniqueName="YTD_Rev" HeaderText="YTD"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PYTD_Rev" UniqueName="PYTD_Rev" HeaderText="PYTD"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="YTDRev_PYTDRev_VAR" UniqueName="YTDRev_PYTDRev_VAR" HeaderText="VAR"   ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right">
                                </telerik:GridBoundColumn>                                    

                            </Columns>
                        </telerik:GridTableView>

                    </DetailTables>
                        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />


                        <Columns>
                            <telerik:GridBoundColumn ReadOnly="true" DataField="Sales RepNo" HeaderText="Sales Rep No" UniqueName="SalesRepNo"  ItemStyle-Width="70" HeaderStyle-Width="70" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"/>
                            <telerik:GridBoundColumn ReadOnly="true" DataField="Sales Rep" HeaderText="Sales Rep Name" UniqueName="SalesRepName"  ItemStyle-Width="110" HeaderStyle-Width="110"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="90px" />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="CM_cases" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="CM" UniqueName="CM"  ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px" AllowFiltering="false" />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="LM_cases" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="CM PY" UniqueName="CMPY"  ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="CM_LM_VAR" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="VAR" UniqueName="MVAR" ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="YTD" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="YTD"  UniqueName="YTD"  ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="PYTD" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="PYTD" UniqueName="PYTD"  ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="YTD_PYTD_VAR" Aggregate="Custom" FooterAggregateFormatString="{0}" HeaderText="VAR" UniqueName="YVAR" ColumnGroupName="Cases"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />

                            <telerik:GridBoundColumn ReadOnly="true" DataField="CM_Rev" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="CM" UniqueName="CMR"  ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="LM_Rev" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="CM PY" UniqueName="CMPYR"  ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="CMRev_LMRev_VAR" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="VAR" UniqueName="VARRM" ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="YTD_Rev" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="YTD" UniqueName="RYTD"  ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="PYTD_Rev" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="PYTD" UniqueName="RPYTD"  ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right"  CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                            <telerik:GridBoundColumn ReadOnly="true" DataField="YTDRev_PYTDRev_VAR" Aggregate="Custom" FooterAggregateFormatString="{0:C0}" HeaderText="VAR" UniqueName="VARRY" ColumnGroupName="Revenue"  ItemStyle-HorizontalAlign="Right" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" FilterControlWidth="50px"  AllowFiltering="false"  />
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
                        <Resizing AllowRowResize="false" EnableRealTimeResize="true" ResizeGridOnColumnResize="false"
                            AllowColumnResize="true"/>



                    </ClientSettings>
                </telerik:RadGrid>
答案

改变了财产

HierarchyLoadMode="ServerOnDemand" 

HierarchyLoadMode="Client"

它就像一个魅力。留给面对这个问题的人。

以上是关于无法崩溃asp.net ajax Telerik gridtableview的主要内容,如果未能解决你的问题,请参考以下文章

AJAX界面开发工具Telerik UI for ASP.NET AJAX全新发布R3 2020

Telerik ASP.NET AJAX - 具有动态创建的 Docks 的 Ajax 更新标签

Telerik ASP.NET Ajax RadGrid 在 MVC 和 ViewState 中?

界面开发工具Telerik UI for ASP.NET AJAX发布R2 2020

如何为 ASP.NET Ajax 重用来自 Telerik RadControls 的 css 样式

用户界面开发工具集Telerik UI for ASP.NET AJAX发布R1 2020 SP1