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
630
Ultrawebgrid Sorting and Binding Issue
posted

Hi,

In our project, we are using Ultrawebgrid with 4 columns, in which 3 columns are added in the design time and allowed to sort. 4th column is a checkbox column added dynamically (run time). Both Paging and Sorting has been implemented.

In the ultrawebgrid1_SortColumn() event, logic has been written to sort the column and bind the data. When the checkbox status is changed and on click of any of the columns to sort, below error page is thrown.

[NullReferenceException: Object reference not set to an instance of an object.]
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.UpdateDBRow(UltraGridRow row, UltraGridRow oldRow) +121
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.ProcessChanges(StateChanges stateChanges, Boolean fireEvents) +1515
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.RaisePostDataChangedEvent() +126
   System.Web.UI.Page.RaiseChangedEvents() +137
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4763
 

So as suggested in some of the forums, ultrawebgrid1.DataBind() method should be moved to Ultrawebgrid1_UpdateGrid() event. So now when the status of the checkbox is changed, UpdateGrid() event fires and binds the grid.. The error page is not shown.

But now without checking or unchecking the checkbox, if we click on the column to sort then SortColumn event fires and the grid is not getting binded.(i.e., page index showing as 1 of 1 Prev Next instead of 1 of 11 Prev Next even though 11 pages are present - only 1 page is shown , since DataBInd is not happening).

Please look into this issue and suggest a solution.

Thanks in advance.

  • 15979
    Suggested Answer
    posted

    Hello grakgem,

    It has been a while since you have made your post, but I suppose the other community members can benefit from this answer as well.

    First thing that you can do is to update your controls with the latest Service Release available. Many of the known issues are regularly fixed with these releases.  You can see our latest service releases in our web site - “Support > Service Releases” and download them from “My IG > My Keys and Downloads” page.

    If the issue is not cause by the control implementation but by application logic you can read the following articles showing the usage of Binding with “UltraWebGrid” in different scenarios - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebGrid_Data_Binding.html

    You may need to bind the grid with data on every Postback or on every Sort operation in order to provide the needed Data Source that the grid can use to count records and display them properly.

    I hope that above information will be useful in this scenario.