I am having difficulty determining how to set the default font for rows in an UltraGrid on the fly at runtime. Is this possible and if so, how?
I can change it during initialization using the Font property, but that changes everyrow, even headers and only works prior to the grid being initialized. I need something that works dynamically, in response to user input, for example.
Thanks,
Doug
Hi Doug,
You can do this by hooking into InitializeRow event of the grid and initialize the row.Appearance based on your criteria.
Appearance blueApp, redApp;
// init above appearances.
// in InitializeRow event handler, assign the row's Appearance to whichever appearance object is applicable to the row based on your criteria.
e.Row.Appearance = blueApp;
This will greatly reduce memory overhead since the same blue or read appearance object will be shared across multiple rows.
Sandip
Sandip,
I was not able to get this to work because the properties for row in the InitializeRow event handler are read-only. Also, I need this to change on-demand after the grid is built and displayed in response to user input, not at initialization. Is this even possible or am I totally missing something really basic?