I'm using Infragistics 2008 Volume 3 UltraWebGrid in an ASP.NET application targeting the 3.0 framework. In my Page_Load I set UltraWebGrid1.DataSource to a dataset returned by another class. The grid is populated all well and good. I have edits/adds/deletes enabled on the grid. I noticed that when I attempt to obtain the dataset bound to the grid's DataSource in a PostBack method call, it is set to Nothing. How do I get the changes that may have been performed by the user to the grid? Do I nee to catch the client side events and make the changes myself on a copy of the Dataset stored in a session variable? I'm fairly new to the ASP.NET side of things. On the WinForms side I'd just grab the dataset bound to the Datasource and call it's .HasChanges method to see if the user did anything; Likewise, I could call the DataTables .GetChanges method to get just what has been changed.
If I am missing something totally obvious, please forgive my ignorace, otherwise and assistance would be appreciated.
Hello,
Can you provide a simplified project with source code, demonstrating clearly what your problems are ?
You said:
>I noticed that when I attempt to obtain the dataset bound to the grid's DataSource in a PostBack method call, it is set to Nothing.
During a PostBack, the DataSet is lost if you don't recreate the DataSet or at least store the DataSet in Session or in Cache.
I have a Webform with the following in the Page_Load:
Try
If Me.IsPostBack = True Then Return Dim Connections As New ConnectionConfiguration UltraWebGrid1.DataSource = Connections.SearchResults() UltraWebGrid1.DataBind() Catch ex As System.Exception Throw ex End Try
I also have a the following:
Protected Sub WebImageButton1_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles WebImageButton1.Click Try Dim Connections As New ConnectionConfiguration Connections.Save(UltraWebGrid1.DataSource) Catch ex As Exception Throw ex End TryEnd Sub
In the event above, UltraWebGrid1.Datasource is ALWAYS nothing, even though it was bound in the Page_Load and the grid visually displays data. I have ViewState turned on for both the page, button and the grid. Am I missing something?