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
20
UltraGrid Properties are getting null
posted

Hi team,

I am facing one issue on ultragrid in my .net winform project using c# language. Details are below:

(1)I have placed the infragistics Ultragrid in a Winform tab page & this tab page resides under a win form say grid-form.

(2)I have one another win-form say preference-form where I can choose to set up which columns to hide & show on the grid in grid-form. This is achieved through event of c#.

(3)The issue comes when I close the grid-from i.e disposing this form. After this when I am changing the settings under preference-form , then the event gets triggered & control goes to one of the helper class of  grid-form & sets the columns visibility property on the grid object.But doing so it throws an exception of Null Reference as there it is finding the DisplayLayout , DataSource properties of the grid as null, however as I can see while debugging that the columns of the grid are not coming null.

(4)If the grid-form is closed then the above mentioned comes, & once the issue comes then it persists even I re-open the grid-form again.

Any help will be greatly appreciated.

Parents
No Data
Reply
  • 12480
    Offline posted

    Hi Utkarsh,

    I believe the reason that you are encountering this issue is because the grid has been disposed in step 3. The DisplayLayout object belongs to the UltraGrid control, and the control would have been disposed when its parent form was closed.

    I am not sure why the issue in step 4 is occurring. However, I believe that it might be related to something getting into an invalid state during the actions of step 3.

    My recommendation is to track the user settings you want to allow separately from the UltraGrid. This will allow your users to modify these settings even if there is no grid open.

    Please let me know if you have any further questions.

Children
No Data