I can't get the Data Schema to save.
I have the UltraWinGrid on my form.
Go into the designer.
Select Basic settings -> Data Schema
Click on Manually Define Schema.
Place a few rows down.
ie CostId, DataType = System.int32, DefaultValue = System.int32 (0)
Amount, DataType = System.decimal, DefaultValue = System.Decimal (0)
I define others as decimal.
Click Ok, and it asks if you will be NOT be supplying a datasource at Runtime/you will be supplying a datasource at Runtime.
I select the "I will be supplying a datasource at runtime"
Hit Ok,
I get the summation signs on my column headers.
If I hit "Apply" then "Ok"
The summation signs disappear.
if I try to go back into the designer, none of the datatype information is retained. It goes back to String and dbnull for the data type and default. Now this may not be the cause of the problem that I'm really having.
I have a summary on the Amount column. If I run it, it works the first time the window get's a datatable. The second time it get's a datatable, it gives me a null reference exception in the control itself.
Sometimes it will work for a few runs, then all of a sudden a Null Reference exception and it gives the stupid message about needing a "new"
The reason is that the schema designer was added to the grid designer along with the UltraDataSource component. The way it works is that the grid schema is saved using an UltraDataSource behind the scenes. So the designer you are seeing is the UltraDataSource designer and since it's using a PropertyGrid, it shows all the properties of the UltraDataColumn, even though some of them are not used.
Ideally, we should probably be hiding those properties that are not valid in the grid designer.
That makes sense, but why let us specify properties that will just be reset?
Edit: It does clearly state on the Save Schema dialog that only the keys and positions of the fields will be saved.
If you manually define a schema, then you must supply a data source to the grid at run-time that matches the schema. The data types of the schema are irrelevant, because the data source will have actually columns with a data type, so the type of the actual data source is used, not the type you specify in the schema. It would not make sense to use the data type in the schema, because if it didn't match the data type of the data source, it would just cause problems with no real benefit.
FWIW, I am having the same issue. While in design mode, I define a scheme for the grid that will have a datasource supplied at runtime. After setting the data types for each column, and exiting the grid designer, all data types are reset to "string".
Is this something that should submitted as a bug report, or is there something I'm not doing correctly?