views:

489

answers:

1

Hello all,

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>
A: 

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.

AGoodDisplayName
Thanks for answer, but unfortunately the ObjectDataSource control supports filtering data only when the Select method returns a DataSet or DataTable object whereas my ObjectDataSource returns List of my objects =(
Jo Asakura