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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Header Font

Thread ID:

Created:

Updated:

Platform:

Replies:

88249 Jul 17,2009 02:40 PM Jul 22,2009 10:33 AM WPF 1
loading
Tags: GridControl
David Allen Lubbers
Asked On July 17, 2009 02:40 PM

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

Clay Burch [Syncfusion]
Replied On July 22, 2009 10:33 AM

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;
}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;