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.

Format Data in GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

30839 Jun 24,2005 10:51 AM Jun 24,2005 12:12 PM Windows Forms 1
loading
Tags: GridControl
jsun@doble.com
Asked On June 24, 2005 10:51 AM

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 12:12 PM

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.

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.

;