Is there a way to determine if an Ultragrid column allows or does not allow nulls. I want to change the header caption (like adding an * to caption and changing the text color) to indicate the column is required. My grids are usually connected to datatables from a dataset. I know there is an AllowNull property on the column in the datatable, but how do I determine this from the Ultragrid column?
Thanks
Hi Lonnie,
it's pretty easy to get to the data column from the grid column, because the keys of the columns and bands will match up - at least for the root level.
So you could use InitializeLayout of the grid to loop through the bands and then the columns within each band. For the root band, you would get the root table with something like this:
dataSet.Tables[gridRootBand.Key]
Then you could index into the table's Columns collection using the same keys as the grid columns.
For child bands, you have to index into the Relationships collection on the DataSet instead of the tables collection.
Mike,
It's been a few weeks since you answered this, but I just wanted to say thanks. I did implement your suggestion and it worked out very well. Appreciate your help.
Thanks again
Lonnie