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.

Restricting , in a particular column ... in Percentage Column

Thread ID:

Created:

Updated:

Platform:

Replies:

47352 Aug 3,2006 07:23 AM Aug 4,2006 08:02 AM Windows Forms 3
loading
Tags: Grouping
Vinay
Asked On August 3, 2006 07:23 AM

Hi,
We are using using percentage columns.
here if we enter 0.02 in cell the output is 2%.

If we enter 0,1 it is showing 100% on screen.

We want to restrict user from this, how can we proceed pls suggest.

we are using 3.x version.
Please suggest solution for that version as we cannot upgrade our project with latest version from yourside.

Thanks
Vinay

Administrator [Syncfusion]
Replied On August 3, 2006 08:04 AM

Hi Vinay,

Try handling the TableControlCurrentCellKeyPress event of the gridGroupingControl to achieve this. Here is the code snippet.

GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
if( style.TableCellIdentity.Column.MappingName == "PercentageColumn" )
{
if(e.Inner.KeyChar == '','')
e.Inner.Handled = true;
}

Let me know if this helps.
Regards,
Rajagopal

Vinay
Replied On August 3, 2006 10:20 AM

Hi Gopal,

This will not solve my problem.
we are restricting all the differtent columns types at a single place.

here we are using
gcd(Grid Column Descriptor)
gcd.Appearance.AnyRecordFieldCell.Format="### ### ##0";
gcd.Appearance.AnyRecordFieldCell.ValidateValue.Minimum
gcd.Appearance.AnyRecordFieldCell.ValidateValue.Maximum

Here I need to restrict entry for ","(Comma) and allow "."(Dot)

Thanks
Vinay


>Hi Vinay,

Try handling the TableControlCurrentCellKeyPress event of the gridGroupingControl to achieve this. Here is the code snippet.

GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
if( style.TableCellIdentity.Column.MappingName == "PercentageColumn" )
{
if(e.Inner.KeyChar == '','')
e.Inner.Handled = true;
}

Let me know if this helps.
Regards,
Rajagopal

Administrator [Syncfusion]
Replied On August 4, 2006 08:02 AM

Hi Vinay,

Instead of checking for any particular column in the TableControlCurrentCellKeyPress event hanlder, just check for the comma key press and handle the event.

if(e.Inner.KeyChar == '','')
{
e.Inner.Handled = true;
}

Let us know if this helps.
Thanks,
Rajagopal

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.

;