Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialListView Column Headers not drawn correctly #74

Open
theXappy opened this issue Nov 6, 2015 · 1 comment
Open

MaterialListView Column Headers not drawn correctly #74

theXappy opened this issue Nov 6, 2015 · 1 comment
Labels

Comments

@theXappy
Copy link

theXappy commented Nov 6, 2015

I tried the MaterialSkinExample project on my machine and noticed the MaterialListView's column headers seem to be drawn like regular winforms ListView headers.

Example:
Here

I've inspected the issue and it seems the overridden method OnDrawColumnHeader is not called.
(I Used a breakpoint at the beginning of the method and it was never reached.)
Usually this means either the View property isn't set to View.Details or the DrawOwner is false but those are taken care of in the constructor.

Furthermore, I tried adding an overriden OnDrawSubItem to MaterialListView.cs and this one WAS called.
( This method have the same "requirements" as the OnDrawColumnHeader - Details View, DrawOwner=true)

I've tried:

  • Running in both debug and release
  • Changing my visual theme: Aero/Windows 7 Basic/Windows Classic
  • Subscribing manually to the DrawColumnHeader event - from within the control and from the owner form.

None of these worked.

@theXappy theXappy changed the title MaterialListView Column Headers now drawn correctly MaterialListView Column Headers not drawn correctly Nov 6, 2015
@IgnaceMaes IgnaceMaes added the bug label Nov 6, 2015
@theXappy
Copy link
Author

theXappy commented Nov 7, 2015

The issue seems to origin in the OnCreateControl method in MaterialListView.cs.
The hack at line 123:

Font = new Font(SkinManager.ROBOTO_MEDIUM_12.FontFamily, 24);

seems to cause an argument exception in System.Drawing saying "Only TrueType fonts are supported. This is not a TrueType font."

Changing the font to a default one like so:

Font = new Font(FontFamily.GenericSerif, 24);

fixes the problem and the headers are drawn correctly.

I also noticed that installing the Roboto font family fixed the problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants