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

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?

 


1 Reply

RA Riyaj Ahamed I Syncfusion Team June 25, 2013 04:59 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon