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

Number Format in DataBoundGrid

Thread ID:





16944 Jul 28,2004 04:00 AM UTC Jul 28,2004 05:59 AM UTC WinForms 1
Tags: GridControl
Asked On July 28, 2004 04:00 AM UTC

Clay, I have set format like "#,###.00(#,###.00)" for one my number column. If the user enters the say -10000, and moves to the another cell. the value -10000 will be displayed like (10,000). Now if user wants to edit that cell again, i want the value in the cell should be displayed like the one user entered i.e. -10000 not the formatted one (10,000) So how to achieve this? Thanks Satish

Administrator [Syncfusion]
Replied On July 28, 2004 05:59 AM UTC

You can handle the CurrentCellInitializeControlText event and do it there.
Private Sub gridControl1_CurrentCellInitializeControlText(ByVal sender As Object, ByVal e As GridCurrentCellInitializeControlTextEventArgs)
     If e.RowIndex = 1 And e.ColIndex = 1 Then
          Dim d As Double = e.CellValue
          If d < 0 Then
              e.ControlText = d.ToString()
          End If
      End If
End Sub


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon