Hi,
Is there such a property in the WinGrid?
I'm supplying my datasource at runtime, and even though I've created the schema, columns that I did not include just showed up on my UltraGrid, is there some setting that I'm missing?
This should help:
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
That helped a lot, thanks!
cidolfus said:So if some of my fields are null, say for example, how where do I set the default null value? Since different columns will have different null values.
I'm not sure what you mean by this. You might be looking for the Nullable property on the UltraGridColumn.
As in like, if there's a Gender column on my grid, and in my database I just stall char(1) 'M' or 'F'. How do I translate that to "male" or "female" on the grid?
There are a number of ways to do that. The easiest way would be to use a ValueList. You would populate the ValueList with Values and DisplayText. The values would be 'M' and 'F' and the displaytext of each item would be "male" and "female" respectively.
How do I set the ValueList?
I went into the designer mode of the grid, under the Band settings. the ValueList property just displayed "none" with no option for me to specify anything.
Is it also possible to dynamically set this ValueList - values/displaytext at runtime?
For a simple ValueList like this, it's probably easier to do it at run-time.
But if you want to do this at design-time, what you would do is go to the grid.DisplayLayout.ValueLists collection and add a ValueList there. Be sure to give your ValueList a Key.
Then the ValueList you created will show up on the list for the column's ValueList property.
At run-time, you would do essentially the same thing inside the InitializeLayout event of the grid. Add a ValueList to the e.Layout.ValueLists collection and populate the ValueListItems collection, then assign the ValueList you created to the ValueList property on the column.
Thanks!