Hi, I have a user control and have a grid inside that. I am setting Grid's one of the columns header TextHAlign as Center.
I could find this settings in designer file
appearance56.TextHAlignAsString = "Center";ultraGridColumn3.Header.Appearance = appearance56;
If I run the App it doesn't center the header caption. I have figured out some wired and bizarre hacks to make it work.
After InitializeComponent() in constructor If I set the settings for this specific column or someother column, then magically all settings are applied and works fine.
ultrarid.DisplayLayout.Bands[0].Columns[1].CellAppearance.TextHAlignAsString = "Center";
Another hack is, if query that property in VS immediate window, it works.
Any help is appreciated.
Thanks,
Se
Hi Se,
It's hard to say without seeing a sample, but my guess is that this has nothing to do with the UserControl. Most likely, the DataSource you are attaching to the grid at run-time does not match the design-time data structure.
Here's a KB article that might 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?
Mike Thanks for the reply. But I am not binding it on run time.