Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Win.UltraWinGrid.UltraGrid Rows.Refresh(RefreshRow.ReloadData) throws Exception

Win.UltraWinGrid.UltraGrid Rows.Refresh(RefreshRow.ReloadData) throws Exception

New Discussion
Sagar Kale
Sagar Kale asked on Nov 21, 2016 4:52 PM

Hi,

   I am facing an issue, while Reloading Data for UltraGrid Control for a VB.Net code. Scenario is, Refresh(RefreshRow.ReloadData) is In Progress for the UltraGrid object and User hits a different form to Load, which Kills the Datasource for the UltraGrid's Form, while the Refresh process is still ON. This internally causes Object reference error.

Could there be any possible workaround to handle this situation?

Code throwing the exception is:

ugrdTest.Rows.Refresh(RefreshRow.ReloadData)

Any help would be appreciated.

Thanks in Advance šŸ™‚ ,

Sagar

Sign In to post a reply

Replies

  • 0
    Mike Bowshewicz
    Mike Bowshewicz answered on Nov 18, 2016 8:29 PM

    Hi Sagar,

    Refresh is a synchronous operation, so it would normally not be possible for a user to load a new form while the operation is in progress. Are you doing something special in your application to allow this? Please let me know.

    As this operation is synchronous, it is unlikely that there is any error handling to anticipate an interruption of this type.

    • 0
      Sagar Kale
      Sagar Kale answered on Nov 21, 2016 7:10 AM

      Hi Mike,

        Thanks for your response.

        My application is enabled with parallel process selection for all the menus, so that Load and other operations can happen asynchronously. I verified, applying null check for  Datasource and Rows properties, which did not resolve the issue. Since the Datasource null is occuring during, ReloadData of Refresh method, i am not finding appropriate check to to be applied for it.

         Any suggestions?

      Thank you,

      Sagar

      • 0
        Mike Bowshewicz
        Mike Bowshewicz answered on Nov 21, 2016 4:52 PM

        Hi Sagar,

        Is your databinding being done on a separate thread? This is not safe in Windows Forms, as controls are not thread-safe and a binding notification coming from somewhere other than the UI thread could cause an exception.

        My recommendation is to bind and refresh the data on the UI thread. Any other data operations that take a long time can be done on a separate thread, as long as the data is properly marshalled to a data source on the UI thread.

        Please let me know if you have any questions.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Sagar Kale
Favorites
0
Replies
3
Created On
Nov 21, 2016
Last Post
9 years, 4 months ago

Suggested Discussions

Tags

Created by

Created on

Nov 21, 2016 4:52 PM

Last activity on

Nov 21, 2016 4:52 PM