How to increase DataGrid column header text size

V

venkateswarag

Hi,

How to set font size for DataGrid column header text in compact
framework 2.0

Any thoughts plesae!!!

Thanks
Venkat
 
A

Arun

Here you go,
private void SetGridDefaultRowHeaderHeight(DataGrid dg, Font fnt)
{
System.Reflection.FieldInfo fi =
dg.GetType().GetField("m_renderer",
BindingFlags.NonPublic |
BindingFlags.Static |
BindingFlags.Instance);
Object obj = fi.GetValue(dg);
Type t =
dg.GetType().Assembly.GetType("System.Windows.Forms.GridRenderer");
fi = t.GetField("m_fntHeader",
BindingFlags.NonPublic | BindingFlags.Static |
BindingFlags.Instance);
fi.SetValue(obj, fnt);
}
 
V

venkateswarag

Here you go,
private void SetGridDefaultRowHeaderHeight(DataGrid dg, Font fnt)
{
System.Reflection.FieldInfo fi =
dg.GetType().GetField("m_renderer",
BindingFlags.NonPublic |
BindingFlags.Static |
BindingFlags.Instance);
Object obj = fi.GetValue(dg);
Type t =
dg.GetType().Assembly.GetType("System.Windows.Forms.GridRenderer");
fi = t.GetField("m_fntHeader",
BindingFlags.NonPublic | BindingFlags.Static |
BindingFlags.Instance);
fi.SetValue(obj, fnt);

}






- Show quoted text -

Thx it's working...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top