ASPxGridView POST 超时

发布于 2024-08-22 01:36:11 字数 1862 浏览 7 评论 0原文

我有一个带有 DetailRow 的 ASPxGridView,在这一行中还有三个附加的 ASPxGridView。每个详细信息 ASPxGridView 都包含 EmptyDataRow 模板,其中包含用于创建新行的链接:

<a href="javascript:gridViewDetails1.AddNewRow();">AddNewRecord</a>

当主 ASPxGridView 行数为 1 或 2 时,详细信息网格中的新行添加良好,但如果主 ASPxGridView 行数约为 10 或更多,则当我单击详细信息网格链接时添加新行,加载面板显示无限时间,FireBug->Net 显示 POST 状态为超时,时间约为 1 秒。

我该如何修复它?

发送至AGoodDisplayName

是绑定到的详细信息行网格视图 有什么吗?

是的,当然,在主 gridView 的详细信息行内有 3 个另一个 gridView,每个都有一个单独的 ObjectDataSource。

您是否扩展了超过一行的内容? 时间?

不,我一次只有一行:

AllowOnlyOneMasterRowExpanded="true"

我们可以看到一些标记吗?

是的:

<asp:ObjectDataSource ID="dsMaster" runat="server" TypeName="..." SelectMethod="...">
</asp:ObjectDataSource>
<dxwgv:ASPxGridView ID="gridViewMaster" ClientInstanceName="gridViewMaster" runat="server" DataSourceID="dsMaster">
    <Templates>
        <DetailRow>
            <%--first of details gridView--%>
            <asp:ObjectDataSource ID="dsDetail1" runat="server" TypeName="..." SelectMethod="...">
            </asp:ObjectDataSource>
            <dxwgv:ASPxGridView ID="gridViewDetail1" ClientInstanceName="gridViewDetail1" runat="server" DataSourceID="dsDetail1">
                <Templates>
                    <EmptyDataRow>
                        <a href="javascript:gridViewDetail1.AddNewRow();">AddNewRecord</a>
                    </EmptyDataRow>
                </Templates>
            </dxwgv:ASPxGridView>
            <%--next others detail gridViews--%>
        </DetailRow>
    </Templates>
</dxwgv:ASPxGridView>

I have a ASPxGridView with DetailRow in this row there are three additional ASPxGridViews. Each detail ASPxGridView contains EmptyDataRow templates with link to create a new row:

<a href="javascript:gridViewDetails1.AddNewRow();">AddNewRecord</a>

When master ASPxGridView rows is 1 or 2 then new rows in detail grids adding fine, but if in master ASPxGridView rows about 10 or more then when I clicking on detail grids link to add new row the loading panel appers for unlimited time and FireBug->Net shows that status of POST is timeout and time is about 1 sec.

How can I repair it?

To AGoodDisplayName:

are the detail row gridviews bound to
anything?

yes of course, inside the details row of master gridView there are 3 another gridView and each of them have a separate ObjectDataSource.

Are you expanding more than row at a
time?

No, I have only one row at time:

AllowOnlyOneMasterRowExpanded="true"

Can we see some of the mark up?

Yep:

<asp:ObjectDataSource ID="dsMaster" runat="server" TypeName="..." SelectMethod="...">
</asp:ObjectDataSource>
<dxwgv:ASPxGridView ID="gridViewMaster" ClientInstanceName="gridViewMaster" runat="server" DataSourceID="dsMaster">
    <Templates>
        <DetailRow>
            <%--first of details gridView--%>
            <asp:ObjectDataSource ID="dsDetail1" runat="server" TypeName="..." SelectMethod="...">
            </asp:ObjectDataSource>
            <dxwgv:ASPxGridView ID="gridViewDetail1" ClientInstanceName="gridViewDetail1" runat="server" DataSourceID="dsDetail1">
                <Templates>
                    <EmptyDataRow>
                        <a href="javascript:gridViewDetail1.AddNewRow();">AddNewRecord</a>
                    </EmptyDataRow>
                </Templates>
            </dxwgv:ASPxGridView>
            <%--next others detail gridViews--%>
        </DetailRow>
    </Templates>
</dxwgv:ASPxGridView>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2024-08-29 01:36:11

我以前遇到过类似的问题,并且能够解决一些问题。我的问题和你的问题之间的区别在于我使用的是 DevExpress XpoDataSource(其 DevExpress 版本的 ObjectDataSource)。

  1. 在设计时我将数据源设置为带回 0 条记录。这样,通过将 FilterExpression 设置为“ID = 0”之类的值,在页面加载时就不会检索任何数据(这对于 3 个网格和 3 个数据源来说成本可能很高)。这似乎对性能产生了最大的影响。

  2. 显然你想带回0条以上的记录,所以你需要在详细信息网格的“BeforePerformDataSelect”事件上设置过滤。

    protected void ASPxGridView1_BeforePerformDataSelect(对象发送者,EventArgs e)
    {
       dsDetail1.FilterExpression = "MasterRecordID = " + (发送者为 ASPxGridView).GetMasterRowKeyValue().ToString();
    }
    

我不确定这是否能解决您的问题,但这就是我所做的并且有帮助。

I have had some problems like this before and was able to some what releive the issue. The difference between my problem and yours is that I was using the DevExpress XpoDataSource (its DevExpress' version of ObjectDataSource).

  1. In design time I set the datasource to bring back 0 records. This way there is no data being retreived at page load (this can be costly for 3 grids and 3 data sources), by setting the FilterExpression to something like "ID = 0". This seemed to make the most difference performance wise.

  2. Obviously you want to bring back more than 0 records, so you need to set the filtering of the on the "BeforePerformDataSelect" event of the Detail grid.

    protected void ASPxGridView1_BeforePerformDataSelect(object sender, EventArgs e)
    {
       dsDetail1.FilterExpression = "MasterRecordID = " + (sender as ASPxGridView).GetMasterRowKeyValue().ToString();
    }
    

I am not sure if this will fix your issue, but this is what I did and it helped.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文