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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Format Data in GridDataBoundGrid

Thread ID:





30839 Jun 24,2005 02:51 PM UTC Jun 24,2005 04:12 PM UTC WinForms 1
Tags: GridControl
Asked On June 24, 2005 02:51 PM UTC

I tried to format data in GridDataBoundGrid by GridDataBoundGrid1[i, j].Format="0.000" or GridDataBoundGrid1[i, j].Format="{0:0.000}" It did not work. Is there a different way (there must be) to format numerical data? Thank you very much for help. J. Sun

Administrator [Syncfusion]
Replied On June 24, 2005 04:12 PM UTC

You cannot set cell specific properties in a GridDataBoundGrid. See this KB. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=83 To set a format on a singler cell is a GridDataBoundGrid, you shuld handle the grid.Model.QueryCellInfo event. In your handler if e.RowIndex and e.ColIndex point to teh cell, set e.Style.Format = "0.00" (for example) and also set e.Style.CellValueType = typeof(double). In order for the formatting to work, the CellValueType property needs to be set. Now if you want to set a format on a column, then you can use teh GridBoundColumn.StyleInfo.Format / CellValueType properties to manage this without handling an event. But if you want to do it cell by cell, you need to handle grid.Model.QueryCellInfo.


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

or the page will be automatically redirected to 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