I have a simple UltraWebGrid that displays the search results based on several criteria. It is working fine until the user clicks on a header to sort the grid. The grid performed the sort just fine; however, when the user enter new search criteria, an NullReferenceException is generated when calling DataBind on the grid.
uwgResult.DataSource = aDataTableuwgResult.DataBind <- This call will generate an exception only after user clicks on any header to sort
Could someone tell me what should be the "correct" way of data binding a new data source?
Thanks.
One thing that might help would be set the DataSource = null (nothing in VB), calling DataBind() and then binding the new datasource. But without being able to see what might be causing the issue, thats about all I can suggest.
I did try that before, same thing happened. I have verified that the new data set has the correct data in it.....
And here is the stack trace when I called DataBind
at Infragistics.WebUI.UltraWebGrid.RowsCollection.Sort() at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.SortGroupRows(RowsCollection rows) at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.PerformGroupRows() at Infragistics.WebUI.UltraWebGrid.DBBinding.BindList(IEnumerable datasource) at Infragistics.WebUI.UltraWebGrid.DBBinding.DataBind(Object dataSource, String dataMember) at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.DataBind() at Results_DailyResults.BindData(DataSet& myDataSet) at Results_DailyResults.SubmitButtonClicked at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
If I use UpdatePanel, I got the error page, but if I use AsyncRefreshPanel, the page post back due to that error as if nothing happened...