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
155
NullReferenceException when databinding new datasource
posted

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 = aDataTable
uwgResult.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.