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.
Syncfusion Feedback

Changing currency symbol in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

11969 Mar 18,2004 08:29 PM UTC Mar 24,2004 01:31 PM UTC Windows Forms 8
loading
Tags: GridControl
Raymond S Gunawan
Asked On March 18, 2004 08:29 PM UTC

Hello, I''m trying to change the currency symbol in a grid control, so I''m using the CurrencyEdit.CurrencySymbol property of the particular cell. This used to work fine, until I used version 2.0.3.0 RC1. Am I doing something wrong? Thanks. Raymond.

Administrator [Syncfusion]
Replied On March 18, 2004 09:05 PM UTC

This is broken. We will get it fixed for the release.

Raymond S Gunawan
Replied On March 23, 2004 07:37 PM UTC

Any estimate on when this will get fixed? We need to get a demo out with this functionality soon. Is there a workaround this that I can use for now? Thanks a bunch! Raymond >This is broken. We will get it fixed for the release.

Administrator [Syncfusion]
Replied On March 23, 2004 08:20 PM UTC

You can handle the CurrentCellControlGotFocus event. In the handler, get the style for the cell and transfer any style.CurrencyEdit properties that you are using to the cell control.
private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e)
{
	GridCurrencyTextBox tb = e.Control as GridCurrencyTextBox;
	if(tb != null)
	{
		GridCurrentCell cc = this.gridControl1.CurrentCell;
		GridStyleInfo style = this.gridControl1[cc.RowIndex, cc.ColIndex];
		tb.CurrencySymbol = style.CurrencyEdit.CurrencySymbol;
		//set whatever other style.CurrencyEdit properties you need
	}
}

Raymond S Gunawan
Replied On March 23, 2004 08:55 PM UTC

Thanks a lot! That works well. However, when I start typing without clicking on the cell first, right after the first number typed, the cursor is reset to the beginning of the line. Hence, if I type in "12", "21" will be shown. Could you tell me how to fix this? Thanks Raymond. >You can handle the CurrentCellControlGotFocus event. In the handler, get the style for the cell and transfer any style.CurrencyEdit properties that you are using to the cell control. > >
>private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e)
>{
>	GridCurrencyTextBox tb = e.Control as GridCurrencyTextBox;
>	if(tb != null)
>	{
>		GridCurrentCell cc = this.gridControl1.CurrentCell;
>		GridStyleInfo style = this.gridControl1[cc.RowIndex, cc.ColIndex];
>		tb.CurrencySymbol = style.CurrencyEdit.CurrencySymbol;
>		//set whatever other style.CurrencyEdit properties you need
>	}
>}
>

Administrator [Syncfusion]
Replied On March 23, 2004 09:24 PM UTC

You can avoid it by making the cell start editing when it becomes the current cell. You can do this grid wide by setting this property. this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent; But if you only want to do it for currencycells, you can handle the CurrentCellMoved event, and start the cell editing there if it is a currency cell.
private void grid_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(!cc.IsEditing && this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "Currency")
	{
		cc.BeginEdit(true);
	}
}

Raymond S Gunawan
Replied On March 23, 2004 10:22 PM UTC

I wanted the cell to act like an Excel cell, so that it doesn''t get activated until I hit a number. Is there a way to do this? Thanks a lot for your help. It''s been really helpful Raymond. >You can avoid it by making the cell start editing when it becomes the current cell. You can do this grid wide by setting this property.

Administrator [Syncfusion]
Replied On March 23, 2004 11:15 PM UTC

I think you will have to wait until we fix the original problem.

Raymond S Gunawan
Replied On March 24, 2004 01:31 PM UTC

Okay then. Thanks a lot for your help! Raymond. >I think you will have to wait until we fix the original problem.

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

;