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
1175
What are the default cell font properties?
posted

When I look at the properties in the property window they all say default, I need to know the default font name and size in points for the grid's cell font, thank you, Jamie

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Jamie,

    Default properties are resolved based on certain other factors. I'm not entirely sure how cells resolve their font. There might be some ultimate default hard-coded into the grid. But my guess is that the cell just uses the Font of the control, which is probably picked up from whatever container the grid is in.

    If you want to get the actual font a cell is using at run-time, then what you can do is use the ResolveAppearance method on the cell. The code would look something like this:

                AppearancePropFlags flags = AppearancePropFlags.FontData;
                AppearanceData appData = new AppearanceData();
                this.ultraGrid1.ActiveCell.ResolveAppearance(ref appData, ref flags);

    Then you can exmaine the appData.FontData.

Reply Children