I'm binding a WebDataGrid (inside a WebPanel) to a dataset, with EnableViewState = 'True', EnableDataViewState = 'False', and paging behavior. The grid populates fine initially via a 'Load Data' button, which retrieves the dataset and binds it to the grid. However, when I choose a paging index, the grid goes blank. I have the Paging.PageIndexChanged event wired to a method in the code behind which rebinds the grid. The method is being called. but the grid goes blank.
I just tested the described scenario and it works perfectly fine for me, no matter if EnableDataViewState is true or false. Can you send us the source or a sample application which reproduces the issue?
Best Regards, Nikola Genov The Infragistics ASP .NET Team
Please find code attached....
Also, if I set EnableDataViewState to TRUE (EnableViewState is also TRUE) and click on the 'Load' button, I get the following exception :
It again works perfectly well, I'm feeding the grid with a sample data DataSet. Are you sure that your CTPBWebService2 always returns properly filled data?
CTPBWebService2 ws = (CTPBWebService2)Session["ctpbdata"];DataSet ds = ws.GetEntrys();
I stepped through everything, and the web service returns the same dataset each time (it's a hard-coded query from a static oracle table).
Please verify that the latest available Service Release is installed. Thanks!
Alex KartavovInfragistics ASP.NET/jQuery Team
Need help? Find the various ways you can ask for help from Infragistics.
I already had SR_2040 installed and just installed SR_2055. But still no luck...
FYI....In the example code I provided above, if I select a page index the grid goes blank, but when I click on the "Load" button, I get data in the grid at the proper page index I chose earlier. The only difference is that the button is posting back, but the paging is not since AJAX is enabled....????
To see if other AJAX features were working properly, I added a sorting behavior. This works fine. But when I click on a page index AFTER I do a column sort, I get this IE error message:
I did some more digging around found some very strange behavior with the paging mechanism. I wired the grid DataBound event to a method in the code-behind that did nothing. I set a breakpoint at this method and for the PageIndexChanged, ColumnSorted, and 'Load' button Click target methods in the code-behind. When I click on the 'Load' button OR sort a column, the DataBound method is called after the respective handler targets. But when I click on a page index, the PageIndexChanged method is called but the DataBound method is NOT.
Is it possible for you to post a sample here? Thanks.
Just wondering if this issue ever got resolved. I'm experiencing the exact same issues. I am currently running build 9.1.20091.2055 with VS 2005.
Paging / Sorting with Datasets FIXED!!
Keep getting the error "DataSource view state corrupt" when you set the EnableDataViewState equal to 'True' in order to get paging/sorting working?-------------------------------------------------------------------DO NOT USE THIS VERSION!!!! 9.1.20091.2055Paging/Sorting with Datasets fixed in 9.2.20092.1003Filtering still broken however when the "Clear Filter" button is selected.Export to Excel component not compatible (must write your own solution)-------------------------------------------------------------------PLEASE NOTE: In order to get the control to work with Datasets it DOES require some very minor additional code above and beyond just enabling the behaviors.
Now rather than leaving people hanging here without some code example with the solution, as seems to be the norm on this site. I will provide the example that was provided to me (only after my company applied some pressure to escalate my issue). It only worked when I upgraded my software to 9.2.20092.1003.
At first glance, I don't fully understand why some of the events are required to get it to work (particularly the Page_Unload event) but here is the simple sample...
==================================================================== Default.aspx====================================================================<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register TagPrefix="ig" Namespace="Infragistics.Web.UI.GridControls" Assembly="Infragistics2.Web.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Aikido WebDataGrid - Paging/Sorting</title></head><body> <h3> Note: As of this writing, this sample works with 9.2.20092.1003. <br /> However, Filtering does not work. </h3> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" EnableDataViewState="true"> <Behaviors> <ig:Paging PageSize="10" QuickPages="2"> </ig:Paging> <ig:Sorting> </ig:Sorting> </Behaviors> </ig:WebDataGrid> </div> <asp:Label ID="Label1" runat="server" Text="Enter some Text here: " Width="154px"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Search" /> </form></body></html>
Imports System.DataImports System.Diagnostics
Partial Class _Default Inherits System.Web.UI.Page
Dim ds As DataSet
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init If Session("GridDataSource") Is Nothing Then ds = New DataSet Else ds = TryCast(Session("GridDataSource"), DataSet) End If End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim str As String = Me.TextBox1.Text
If (ds.Tables.Count > 0) Then Me.WebDataGrid1.DataSource = ds Me.WebDataGrid1.DataBind()
Me.WebDataGrid1.Visible = True Else Me.WebDataGrid1.Visible = False End If End Sub
Private Function GetDataSet(ByVal str As String) As DataSet Dim ds As New DataSet Dim dt As New DataTable
dt.Columns.Add("Col1") dt.Columns.Add("Col2") dt.Columns.Add("Col3")
For index As Integer = 1 To 100
Dim dr As DataRow = dt.NewRow dr(0) = str + " Col1 Row" + index.ToString dr(1) = str + " Col2 Row" + index.ToString dr(2) = str + " Col2 Row" + index.ToString dt.Rows.Add(dr)
Return ds End Function
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ds = GetDataSet(TextBox1.Text)
If (Not ds Is Nothing) Then Me.WebDataGrid1.DataSource = ds Me.WebDataGrid1.DataBind()
Me.WebDataGrid1.Visible = True End If End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload Session("GridDataSource") = ds End Sub
There is another 9.1 hotfix out. We'd appreciate if you let us know whether it's working there too. Thanks.