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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataBoundGrid currency cell type?

Thread ID:

Created:

Updated:

Platform:

Replies:

11780 Mar 15,2004 11:15 PM UTC Mar 16,2004 10:56 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 15, 2004 11:15 PM UTC

How do I change the cell type for a column in a databound grid? Thanks

Administrator [Syncfusion]
Replied On March 16, 2004 07:23 AM UTC

You set the CellType property of the GridBoundColumn.StyleInfo of that column. Here is a KB link that shows code to set BackColor. http://www.syncfusion.com/Support/article.aspx?id=562 You would do the same for CellType. If you want the CellType to be "Currency", then you may need to set other properties as shown in the Grid\Samples\CellTypes\Currency sample.

Administrator [Syncfusion]
Replied On March 16, 2004 10:34 PM UTC

I set the celltype like you said but it just throws an exception now... I looked at that example and it only looks like it works for a GridControl... Am I missing something? Is there a way to loop thorugh the values displayed so I can set there celltype and cellvalue appropriately in a DataBoundGrid? >You set the CellType property of the GridBoundColumn.StyleInfo of that column. Here is a KB link that shows code to set BackColor. > >http://www.syncfusion.com/Support/article.aspx?id=562 > >You would do the same for CellType. If you want the CellType to be "Currency", then you may need to set other properties as shown in the Grid\Samples\CellTypes\Currency sample.

Administrator [Syncfusion]
Replied On March 16, 2004 10:47 PM UTC

I tried adding the following code and each call to the StyleInfo causes an error saying Object not set to an instance of an object... this.ticketGrid.GridBoundColumns["Face"].StyleInfo.CellValueType = typeof(double); this.ticketGrid.GridBoundColumns["Face"].StyleInfo.CellValue = 1; this.ticketGrid.GridBoundColumns["Face"].StyleInfo.CellType = "C"; this.ticketGrid.GridBoundColumns["Face"].StyleInfo.StrictValueType = false;

Administrator [Syncfusion]
Replied On March 16, 2004 10:56 PM UTC

What kind of values are coming from your DataSource? Here is code that works for double values coming from the datasource in the attached sample. Dim style As GridStyleInfo = Me.gridDataBoundGrid1.Binder.InternalColumns("$amount").StyleInfo style.CellType = "Currency" style.CurrencyEdit.ClipMode = Syncfusion.Windows.Forms.Tools.CurrencyClipModes.ExcludeFormatting forum11780_1942.zip

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.

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

;