20
WebHierarchicalDataGrid Async Request failed
posted

I am using WebHierarchicalDataGrid v15.1 and evert thing was working well suddenly our tester reported issue with WebHierarchicalDataGrid while expand the rows getting error " Async Request failed  .... "

so i tried to use others solutions on the forms by   setting the InitialDataBindDepth="-1" InitialExpandDepth="-1" this fix the row expand issue but cause other issue (" Async Request failed  ....") with the paging and row selection.

here is the full code of the WHD

 <ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" InitialDataBindDepth="-1" InitialExpandDepth="-1" ClientIDMode="Static" runat="server" Width="100%" AutoGenerateBands="False" AutoGenerateColumns="False" DataKeyFields="Code,Company_Ser" DataMember="SqlDataSource1_DefaultView" DataSourceID="WebHierarchicalDataSource1" Key="SqlDataSource1_DefaultView" StyleSetName="Office2007Silver">
                                    <Bands>
                                        <ig:Band AutoGenerateColumns="False" DataMember="SqlDataSource2_DefaultView" Key="SqlDataSource2_DefaultView" >
                                            <Columns>
                                                <ig:BoundDataField DataFieldName="SI_Code" Key="SI_Code" Hidden="True" CssClass="ColHeader">
                                                    <Header Text="الاجمالي" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>

                                                <ig:BoundDataField DataFieldName="Ser" Key="Ser" CssClass="ColHeader">
                                                    <Header Text="مسلسل" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>
                                                <ig:BoundDataField DataFieldName="Code" Key="Code" Hidden="True" CssClass="ColHeader">
                                                    <Header Text="Company_Ser" CssClass="ColHeader">
                                                    </Header>
                                                    <Header Text="Code" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>
                                                <ig:BoundDataField DataFieldName="DescA" Key="DescA" CssClass="ColHeader">
                                                    <Header Text="SI_Code" CssClass="ColHeader">
                                                    </Header>
                                                    <Header Text="الوصف" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>
                                                <ig:BoundDataField DataFieldName="Company_Ser" Key="Company_Ser" Hidden="True" CssClass="ColHeader">
                                                    <Header Text="الخصم" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>
                                                <ig:BoundDataField DataFieldName="Quantity" Key="Quantity" CssClass="ColHeader">
                                                    <Header Text="الكمية" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>
                                                <ig:BoundDataField DataFieldName="Price" Key="Price" CssClass="ColHeader">
                                                    <Header Text="السعر" CssClass="ColHeader">
                                                    </Header>
                                                </ig:BoundDataField>

                                                <ig:BoundDataField DataFieldName="Ded_Value" Key="Ded_Value" CssClass="ColHeader">
                                                    <Header Text="الخصم" CssClass="ColHeader"></Header>
                                                </ig:BoundDataField>

                                                <ig:BoundDataField DataFieldName="LCost" Key="LCost" CssClass="ColHeader">
                                                    <Header Text="الاجمالي" CssClass="ColHeader"></Header>
                                                </ig:BoundDataField>

                                            </Columns>
                                        </ig:Band>
                                    </Bands>
                                    <Columns>
                                        <ig:BoundDataField DataFieldName="Code" Key="Code" CssClass="ColHeader">
                                            <Header Text="الكود" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="DescA" Key="DescA" CssClass="ColHeader">
                                            <Header Text="الوصف" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="TDate" Key="TDate" CssClass="ColHeader">
                                            <Header Text="التاريخ" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="Customer_DescA" Key="Customer_DescA" CssClass="ColHeader">
                                            <Header Text="العملاء" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="Status" Key="Status" CssClass="ColHeader">
                                            <Header Text="الحالة" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="Company_Ser" Key="Company_Ser" Hidden="True" CssClass="ColHeader">
                                            <Header Text="Company_Ser" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="Currencies_DescA" Key="Currencies_DescA" CssClass="ColHeader">
                                            <Header Text="العملة" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                        <ig:BoundDataField DataFieldName="Lcost" Key="Lcost" CssClass="ColHeader">
                                            <Header Text="اجمالي الفاتورة" CssClass="ColHeader">
                                            </Header>
                                        </ig:BoundDataField>
                                    </Columns>
                                    <Behaviors>
                                        <ig:SummaryRow FormatString="{0} = {1:0,0.00}" SummariesCssClass="SummaryRow">
                                        </ig:SummaryRow>
                                        <ig:Filtering>
                                        </ig:Filtering>
                                        <ig:Paging PagerMode="NumericFirstLast" PagerCssClass="Paging" PageSize="20" PageIndex="0" Enabled="true" QuickPages="10" FirstPageText="الاول" LastPageText="الاخير" NextPageText="التالي" PreviousPageText="السابق" >
                                        </ig:Paging>

                                        <ig:Sorting>
                                        </ig:Sorting>


                                        <ig:RowSelectors>
                                        </ig:RowSelectors>

                                        <ig:Selection CellClickAction="Row" RowSelectType="Single" CellSelectType="None">
                                            <SelectionClientEvents RowSelectionChanged="WebHierarchicalDataGrid1_Selection_RowSelectionChanged" />
                                            <AutoPostBackFlags CellSelectionChanged="true" />

                                        </ig:Selection>

                                    </Behaviors>
                                </ig:WebHierarchicalDataGrid>

                        <ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server">
                                    <DataViews>
                                        <ig:DataView ID="SqlDataSource1_DefaultView" DataMember="DefaultView" DataSourceID="SqlDataSource1" />
                                        <ig:DataView ID="SqlDataSource2_DefaultView" DataMember="DefaultView" DataSourceID="SqlDataSource2" />
                                    </DataViews>
                                    <DataRelations>
                                        <ig:DataRelation ChildColumns="SI_Code,Company_Ser" ChildDataViewID="SqlDataSource2_DefaultView" ParentColumns="Code,Company_Ser" ParentDataViewID="SqlDataSource1_DefaultView" />
                                    </DataRelations>
                                </ig:WebHierarchicalDataSource>

                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT
                                                                                                         Sales_Invoices.Code,
                                                                                                         Sales_Invoices.DescA,
                                                                                                         convert(varchar,TDate,103)as TDate,
                                                                                                         CASE
                                                                                                         WHEN Sales_Invoices.Status   = 'O' THEN 'مفتوح'  WHEN Sales_Invoices.Status = 'P' THEN 'مغلق' END as Status,
                                                                                                         Customers.DescA as Customer_DescA,
                                                                                                         Currencies.DescA as Currencies_DescA,
                                                                                                         Sales_Invoices.Company_Ser,
                                                                                                         dbo.Get_SalesInvoice_NetValue(Sales_Invoices.Code, @Company_Ser) as Lcost
                                                                                                         FROM Sales_Invoices
                                                                                                         JOIN Customers
                                                                                                         on Sales_Invoices.Customer_Code = Customers.Code
                                                                                                         and Sales_Invoices.Company_Ser = Customers.Company_Ser
                                                                                                         JOIN Currencies
                                                                                                         on Sales_Invoices.Cur_Code = Currencies.Code
                                                                                                         AND Sales_Invoices.Company_Ser = Currencies.Company_Ser
      
                                                                                                         WHERE Sales_Invoices.Company_Ser = @Company_Ser
                                                                                                         and Sales_Invoices.TDate &gt;=  @d1 and Sales_Invoices.TDate &lt; @d2"
                                                                                                          
                                    ConnectionString="<%$ ConnectionStrings:ErpConnectionString %>">
                                    <SelectParameters>
                                        <asp:CookieParameter CookieName="k_compSerial" DefaultValue="1" Name="Company_Ser" />
                                         <asp:Parameter Name="d1" Type="String" />
                                         <asp:Parameter Name="d2" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <ig:WebExcelExporter ID="ExcelExport" runat="server" DownloadName="Excel" DataExportMode="DataInGridOnly" ExportMode="Download">
                                </ig:WebExcelExporter>
                                <ig:WebDocumentExporter ID="PdfExport" runat="server" DownloadName="PDF" DataExportMode="DataInGridOnly" ExportMode="Download"></ig:WebDocumentExporter>
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ErpConnectionString %>"
                                    SelectCommand="SELECT      Sales_Invoice_Details.SI_Code, Sales_Invoice_Details.Company_Ser, Sales_Invoice_Details.Ser, Items.Code, Items.DescA, Sales_Invoice_Details.Quantity, Sales_Invoice_Details.Price,
                           Sales_Invoice_Details.Ded_Value, Sales_Invoice_Details.LCost
                           FROM            Sales_Invoice_Details INNER JOIN
                           Items ON Sales_Invoice_Details.Company_Ser = Items.Company_Ser
                           and Sales_Invoice_Details.Item_Code = Items.Code
                        
                           where Sales_Invoice_Details.Company_Ser = @companySer order by ser">
                                    <SelectParameters>
                                        <asp:CookieParameter CookieName="k_compSerial" DefaultValue="1" Name="companySer" />
                                    </SelectParameters>
                                </asp:SqlDataSource>

note i am using update panel and tried to remove it but nothing happened.

So anyone can help me to fix this issue.

Thanks

  • 4835
    Offline posted

    Hello Peter,

    Thank you for posting in our forum.

    Make sure that you provide the data source for the grid on each postback and DataKeyFields should match the primary key of the collection you’re binding them to and should be unique for each record.

    By default the grid loads the child row islands on demand which means that when you expand a row an ajax request is made to the server to retrieve the data for that specific row island.

    If you don’t have the data source set for the grid during that postback then the row island creation will fail and an error will be raised.

    Alternatively if you want all child row islands to be loaded on the initial load you can set only InitialDataBindDepth to “-1”.

    Would recommend you to go through this document for more information:

    https://www.infragistics.com/help/aspnet/webhierarchicaldatagrid-load-on-demand 

    You can also try putting WebHierarchical DataGrid inside update panels with the grid EnableAjax="false". 

    Please let me know if you need further assistance on this matter.