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 editing font

Thread ID:

Created:

Updated:

Platform:

Replies:

109567 Jun 20,2013 05:12 AM Jun 25,2013 12:59 AM WinRT 1
loading
Tags: SfDataGrid
Robert Fairlie
Asked On June 20, 2013 05:12 AM

Hi,

I have a data grid with two GridTextColumns like:

<syncfusion:GridTextColumn MappingName="X" AllowSorting="False" CellStyle="{StaticResource gridCellStyle}"/>

 

I've set "AllowEditing" to true on the grid, and  I've set the cells to have a smaller than standard font using:

<Style x:Key="gridCellStyle" TargetType="syncfusion:GridCell">

<Setter Property="FontFamily" Value=" Segoe UI" />

<Setter Property="FontSize" Value="12" />

</Style>

When I edit a cell, the text edit box uses a larger font than the one I'm using for the cells. It's not a big problem, because the text is still perfectly legible. However I'd like to use the same font for the cell and the edit field if possible. Is there a way to set the font of the text edit box?

 


Riyaj Ahamed I [Syncfusion]
Replied On June 25, 2013 12:59 AM

Hi Robert,

 

Thanks for contacting Syncfusion support.

 

TextBlock is loaded in normal mode and TextBox is loaded in edit mode as content to the GridCell. When we apply style for the ContentControl, TextBox does not override the values like font styling. We suspect this is an issue with Microsoft framework. However you can achieve this requirement by applying style directly to TextBox.  By defining corresponding TextBox style inside the SfDataGrid.Resources you can show the same font while cell is in edit mode. The following code snippet illustrates this,

 

[XAML]

 

<sync:SfDataGrid.Resources>

<Style TargetType="TextBox">

<Setter Property="FontSize" Value="16"/>

</Style>

</sync:SfDataGrid.Resources>

 

 

Please let us know if you need further assistance.

 

Regards,

Riyaj Ahamed I


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.

;