We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Header Font

How do I set the font in the cell header of the GridDataControl in xaml?

1 Reply

CB Clay Burch Syncfusion Team July 22, 2009 02:33 PM UTC

Currently, there is no way to set the column header font from xaml. We will expose a property to do so.

Currently, you can only set it from code through an event.


//use the ModelLoaded event to subscribe to the PrepareRenderCell event on the embedded GridControlBase.
grid.ModelLoaded += new EventHandler((sender, e) => grid.Model.Views.First().PrepareRenderCell += new GridPrepareRenderCellEventHandler(Window1_PrepareRenderCell));


//the event handler
void Window1_PrepareRenderCell(object sender, GridPrepareRenderCellEventArgs e)
{
GridDataStyleInfo style = e.Style as GridDataStyleInfo;
if (e.Style.CellIdentity.RowIndex == 0)
{
e.Style.Font.FontSize = 22;
e.Style.Font.FontWeight = FontWeights.Bold;
}
}

Loader.
Live Chat Icon For mobile
Up arrow icon