Home Forums WinForms controls Xceed Grid for WinForms Problem on dynamically creating a GridControl Reply To: Problem on dynamically creating a GridControl

User (Old forums)
Member
Post count: 23064

Well, I wonder if you don’t have an exception that is swallowed by the grid or the .NET framework.

Is the debugger set to break on all exceptions? (Debug Menu -> Exceptions -> Common Language Runtime Exception, then select “Break into the debugger” radio button in VS2003, or select “Thrown” CheckBox in VS2005/2008).

If you are in VS2005/2008, make sure the “Enable Just My Code” CheckBox is unselected (Tools Menu -> Options -> Debugging -> General).

This will make sure that no exceptions are swallowed by the grid or the framework, and that the debugger will break in any part of the code, not just yours.

In fact, when leaving the AutoCreateColumns to true, and not providing the columns manually, the order in which you wrote you code should raise an exception, because you try to access a column that does not yet exist in the grid, when setting the FormatSpecifier.  You have to set the grid binding first, so the grid will create the columns, so you can access and set them after.

 

Imported from legacy forums. Posted by André (had 1067 views)