Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Use a custom font for a particular column (privateFontCollection)
posted

 Hi,

 

I have created my own font to display some data in an ultragrid column. This font has been addded to a privateFontCollection (a class instance member), as described at http://msdn2.microsoft.com/en-us/library/y505zzfw(VS.80).aspx 

I wanted to use the standard font for the entire ultraGrid, exept for this particular column.  When I set the FontData.Name property to my Font name, nothing happen. In fact, only system installed fonts names causes the font data to change.

I searched around and found that the only way to display data with my font is to create a font object based on the privateFontCollection fontFamily object and to assign this font object to the UltraGrid's Font property. But when I set it, all the UltraGrid strings are displayed with the custom font.To avoid that, I stored the original UltraGrid font and reassign all FontData properties (exept for the column that uses custom font) with the common font properties. This is a tricky workaround...

 

I wanted to know if there is an easy way to use a custom font for an entire column, and only for that column.

 

Thanks

Rico 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Rico,

        The grid doesn't have any way to access your PrivateFontCollection. You could apply the font to the entire grid and then apply a different font to everyother column and all of the headers, but I can understand how this would not be ideal.

        The best I can recommend if that you submit this to Infragistics as a feature request. Perhaps we can expose a way for the FontData to initialize itself from a Font object, rather than a name like it does now.

         Request a Feature or Component

Children
No Data