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

Undesirable changing font size of field in GridDataBoundGrid

I'm developing a project in Arabic language and I have a weird issue using DataGridBoundGrid. I could explain this as when I click on the field to type something especially combination of numbers and letters in Arabic the font size decreases and when the field loses focus it returns to its original font size. Is there any way to stop this behavior as when I type the font size never changes?

5 Replies

AR Arulpriya Ramalingam Syncfusion Team May 8, 2017 11:54 AM UTC

Hi Xetod, 

Thanks for your interest in Syncfusion products. 

We have analyzed your reported scenario and unfortunately we could not able to reproduce the issue at our end.  

Can you please provide the below details which will help us to provide better solution at the earliest. 
  • Please provide the information about the product version and Frame work version.
  • Please ensure that the issue occurred in the attached sample.
  • Provide us with the simple video or screen shots of your scenario.


XE xetod May 8, 2017 01:32 PM UTC

Thanks for the answer.
I'm using .Net Framework 4.5 and Syncfusion 15.1450.0.33.
I attached a sample video about when the issue occurs. 

Attachment: video_sample_2fe8944d.zip

AR Arulpriya Ramalingam Syncfusion Team May 9, 2017 12:48 PM UTC

Hi Xetod, 

Thanks for your update. 

We have analyzed your reported scenario with our source. It is the default behavior of cell text drawing in our source. As per our Grid architecture, the cell text and the cell styles are drawn by using Graphics(GDI). So if the cell is in editing mode, the starting position of the text will differs from the starting position of the cell which is not in editing mode. We regret to say that the GridDataBoundGrid does not have the support or any extensibility to change this behavior. 

Please let us know, if you need any further assistance. 


XE xetod May 9, 2017 01:26 PM UTC

Thanks for your effort to solve my issue.It's really appreciated.
For now, is there any way to force the cell on editing to change the font size when typing because I tried this code but It doesn't work.

 Private Sub gdbTelephone_CurrentCellControlKeyMessage(sender As Object, e As GridCurrentCellControlKeyMessageEventArgs) Handles gdbTelephone.CurrentCellControlKeyMessage

        CType(Me.gdbTelephone.CurrentCell.Renderer, Syncfusion.Windows.Forms.Grid.GridTextBoxCellRenderer).StyleInfo.Font.Size = 11

    End Sub

AR Arulpriya Ramalingam Syncfusion Team May 10, 2017 06:06 AM UTC

Hi Xetod, 

Thanks for your update. 

We could able to understand your scenario and this reported scenario can be achieved by some workaround using QueryCellInfo event. In that event, Font.Size property can be used to set the font size on editing.  

Code snippet 
'Event Subscription 
AddHandler Me.gridDataBoundGrid1.Model.QueryCellInfo, AddressOf Model_QueryCellInfo 

'Event Customization 
Private Sub Model_QueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) 
    Dim currentCell As GridCurrentCell = gridDataBoundGrid1.CurrentCell 
    If currentCell IsNot Nothing AndAlso e.RowIndex = currentCell.RowIndex AndAlso e.ColIndex = currentCell.ColIndex AndAlso currentCell.IsEditing Then 
        e.Style.Font.Size = 15.0F 
        e.Handled = True 
    End If 
End Sub 

Live Chat Icon For mobile
Up arrow icon