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
1640
frequent exception in the ultragrid designer when editorcomponent used
posted

Hi.
 
Something with the UltraGrid designer has been bothering me for months.
 
Whenever a UltraGridColumn is set with a EditorComponent ,  the UltraGrid designer frequently reports an exception as shown above. When I set the EditorComponent to none, everything seems OK.
 
I found this after the 2009.2 version, before which it was the EditorControl property and no exception raised in the designer. Is it the compatibility issue between the versions?
 
How can I fix this?
Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    It's very hard to say what could be causing this without being able to reproduce the issue. Are you able to reproduce this error in a small sample project, or can you give me some steps to follow to make this happen?

    I took a quick look at the source code for the method where property getter of the EditorComponent property and the very first thing it does is bail out if it's in Design-mode, so something must be getting confused here about what mode the control is actually in. Is your grid in a UserControl or some other container or directly on a form? Are you deriving your own control from the grid? I've seen cases where Visual Studio can become confused about whether it's Design mode or not when controls are inside UserControls.

    Even so, I took a look at the rest of the code in this property and I don't see anything in there that could possibly result in a NullReferenceException. The code in the method is good about doing all the proper null checks. It's possible that a method that is called is blowing up, but you would expect that to show up in the call stack if it were the case. Unless maybe VS is inlining the code for optimization.

    If you can create a sample so we can duplicate the issue, we will be happy to look into it and get it corrected. If not, you might want to consider simply assigning your editor components at run-time, in the InitializeLayout event of the grid as a workaround.

Reply Children