Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Deserialization failure: Invalid response.
posted

Hi,

I am new to infragistics control,i am working on asp.net website.

It is the first time i use the WebDataGrid!

I just have noticed that the virtual scrolling on the WebDataGrid is causing a ERROR~

 

There was an error  "Deserialization failure: Invalid response. " When i move the scrolling.

i dunna why~

Kandly help~THX~

Parents
  • 49378
    posted

    Hi EvenChen,

    I have investigated your scenario but am so far unable to replicate your issue. 

    In order to research this matter I would need to know what version of .NetAdvantage you are using. A sample which demonstrates the issue would be greatly appreciated. It would also help to know the type and size (# of rows) of your data source.

    Please contact me if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

Reply Children
  • 390
    posted in reply to [Infragistics] Petar Ivanov

    Hi, I do have the same problem with my datagrid and am using version 2010 Vol3. Refer to this post for my code: http://community.infragistics.com/forums/p/60820/310160.aspx#310160

    What is interesting is that I load my grid with 2 different set of data: 1 is returning me the error when I sort (filter, etc.) on the second try, but not the other set of data. When seeing that, I assumed the problem was with my datasource objects that could have a serialization problem. I changed my object list to something simpler for my testing and I still get the same error.

    I dynamically create my columns:

    if (this.Parameters.ReportValues.ReportId == DeserializationFailureReport)
          {
             this.AddColumn("Number", "Number", String.Empty, 7, typeof(string));
            this.AddColumn("Type", "Type", String.Empty, 9, typeof(string));
            this.AddColumn("Date", "Time", "{0:dd/MM/yyyy HH:mm:ss}", 13, typeof(DateTime));
            this.AddColumn("ErrorCode", "Code", String.Empty, 5, typeof(int));
            this.AddColumn("ErrorDescription", "Error", String.Empty, 40, typeof(string));
            this.AddColumn("Address", "Location", String.Empty, 22, typeof(string));
          }
          else if (this.Parameters.ReportValues.ReportId == WorkingReport)
          {
               this.AddColumn("Number", "Number", String.Empty, 7, typeof(string));
              this.AddColumn("ype", "Type", String.Empty, 9, typeof(string));
              this.AddColumn("Start", "Start", "{0:dd/MM/yyyy HH:mm:ss}", 13, typeof(DateTime));
              this.AddColumn("End", "Stop", "{0:dd/MM/yyyy HH:mm:ss}", 13, typeof(DateTime));
              this.AddColumn("Distance", "Distance (Km)", "{0:#0.###}", 8, typeof(Decimal));
              this.AddColumn("TimeInMinutes", "Time (hh:mm:ss)", "{0:hh\\:mm\\:ss}", 6, typeof(TimeSpan),  new FormatRecordItemValue(FormatTimeSpan));
              this.AddColumn("Qty1", "Qty1", "{0:#0.##}", 6, typeof(Decimal));
              this.AddColumn("Qty2", "Qty2", "{0:#0.##}", 6, typeof(Decimal));
              this.AddColumn("Qty3", "Qty3", "{0:#0.##}", 8, typeof(Decimal));
              this.AddColumn("Qty4", "Qty4", "{0:#0.##}", 6, typeof(Decimal));
              this.AddColumn("Qty5", "Qty5", "{0:#0.##}", 6, typeof(Decimal));
              this.AddColumn("Qty6", "Qty6", "{0:#0.##}", 6, typeof(Decimal));
          }
    }

    for my testing, I gave the grid a List<Test> object and Test is defined as:

     

    [Serializable]
          public class Test
          {
              private string _number;
                private string _type;
                private DateTime _date;
                private int _errorCode;
                private string _errorDescription;
                private string _address;
                private int _report;

                public string Number
              {
                  get
                  {
                      return _number;
                  }
                  set
                  {
                     _number = value;
                  }
              }

            public string Type
              {
                  get
                  {
                      return _Type;
                  }
                  set
                  {
                      _Type = value;
                  }
              }

            public DateTime Date
              {
                  get
                  {
                      return _date;
                  }
                  set
                  {
                      _date = value;
                  }
              }

            public int ErrorCode
              {
                  get
                  {
                      return _errorCode;
                  }
                  set
                  {
                      _errorCode = value;
                  }
              }

            public string ErrorDescription
              {
                  get
                  {
                      return _errorDescription;
                  }
                  set
                  {
                      _errorDescription = value;
                  }
              }

            public string Address
              {
                  get
                  {
                      return _address;
                  }
                  set
                  {
                      _address = value;
                  }
              }

            public int Report
            {
                get
                {
                    return _report;
                }
                set
                {
                    _report = value;
                }
            }

          }

    I populate the list, then I call this:

     this.reportDataIGGrd.ClearDataSource();
    this.reportDataIGGrd.DataKeyFields = "Report";
    this.reportDataIGGrd.DataSource = lst;
    this.reportDataIGGrd.DataBind();

    In the page_load, I set the datasource back with the list when filtering, sorting or paging is done:

    if (!String.IsNullOrEmpty(this.Request.Form["hdnGridAction"]))
    {
     this.reportDataIGGrd.DataSource = lst;
    }

    Here's my grid in the aspx:

    <asp:UpdatePanel ID="dataGridUpdPnl" runat="server" >
                                    <ContentTemplate>
                                        <input type="hidden" id="hdnGridAction" name="hdnGridAction" />
                                        <ig:WebDataGrid ID="reportDataIGGrd" runat="server" AutoGenerateColumns="false" InitialExpandDepth="-1"
                                             EnableDataViewState="true" DataKeyFields="Report" EnableAjax="true"
                                            AjaxIndicator-Enabled="True" AjaxIndicator-BlockArea="Control" AjaxIndicator-BlockCssClass="ig_AjaxIndicatorBlock" Height="100%" Width="100%"
                                            InitialDataBindingDepth="-1" >
                                            <Columns>
                                            </Columns>
                                            <Behaviors>
                                                <ig:Activation Enabled="true" />
                                                <ig:Selection RowSelectType="Multiple" CellClickAction="Row" Enabled="true" />
                                                <ig:Sorting SortingMode="Single" Enabled="true"  SortingClientEvents-ColumnSorting="SetGridAction" SortingClientEvents-ColumnSorted="ClearGridAction"/>
                                                <ig:Filtering Alignment="Top" Visibility="Visible" Enabled="true" AnimationEnabled="true" FilteringClientEvents-DataFiltering="SetGridAction" FilteringClientEvents-DataFiltered="ClearGridAction"  />
                                                <ig:Paging PagerAppearance="Both" PagerMode="NumericFirstLast"    PagingClientEvents-PageIndexChanging="SetGridAction" PagingClientEvents-PageIndexChanged="ClearGridAction"
                                                        QuickPages="3" PageSize='<%$ appSettings:PageSize_ReportDataMapGrid%>'
                                                        FirstPageText="First" LastPageText="Last" > 
                                                    </ig:Paging>
                                            </Behaviors>
                                            <EmptyRowsTemplate>
                                                <div style="text-align: center;">
                                                    <br />
                                                    <br />
                                                    <img src="Images/information.gif" alt="!" align="middle" />
                                                    &nbsp;&nbsp;&nbsp;
                                                    <asp:Label ID="noDataLabel" runat="server" Text="No records found." Font-Size="Small"
                                                        ForeColor="#000099" Font-Bold="True">
                                                    </asp:Label>
                                                </div>
                                            </EmptyRowsTemplate>
                                            <ErrorTemplate>
                                                <div style="text-align: center; width: 800px;">
                                                    <img src="Images/error.png" alt="!" align="middle" />
                                                    &nbsp;&nbsp;&nbsp;
                                                    <asp:Label ID="errorLabel" runat="server" Text="An error has occurred! Please contact support."
                                                        Font-Size="Small" ForeColor="#CC0000" Font-Bold="True">
                                                    </asp:Label>
                                                </div>
                                            </ErrorTemplate>
                                            <ClientEvents Initialize="intializeGrid" />
                                           
                                        </ig:WebDataGrid>
                                       
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnClear" EventName="Click" />
                                    </Triggers>
                                </asp:UpdatePanel>