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

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

Thread ID:

Created:

Updated:

Platform:

Replies:

47352 Aug 3,2006 11:23 AM UTC Aug 4,2006 12:02 PM UTC WinForms 3
loading
Tags: Grouping
Vinay
Asked On August 3, 2006 11:23 AM UTC

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

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 02:20 PM UTC

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

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.

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

;