This is a migrated thread and some comments may be shown as answers.

GridViewMaskBoxColumn negative values

1 Answer 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
gabi
Top achievements
Rank 1
gabi asked on 01 Jun 2010, 09:25 AM

I write the program in VB.
I have a RadGrid with some GridViewMaskBoxColumns with Mask="n3" and MaskType=Numeric.
When i put negative values in that cell afer i finish the edit the minus symbol disappears.
How can i put negative values in those cells?

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 04 Jun 2010, 03:21 PM
Hello gabi,

There is an issue which concerns the usage of negative values in a numeric GridViewMaskBoxColumn. We will address it in a future version.

You can workaround the issue by using a custom RadMaskedEditBoxEditor. Please create it as discussed in this forum thread. Use the following code to handle the minus symbol:
public override void BeginEdit()
{
    base.MaskTextBox.KeyUp += new KeyEventHandler(MaskTextBox_KeyUp);
    base.BeginEdit();
}
 
public override bool EndEdit()
{
    base.MaskTextBox.KeyUp -= new KeyEventHandler(MaskTextBox_KeyUp);
    return base.EndEdit();
}
 
void MaskTextBox_KeyUp(object sender, KeyEventArgs e)
{
    if (e.KeyValue == 109)
    {
        base.MaskTextBox.MaskEditValue = -Convert.ToDecimal(base.MaskTextBox.MaskEditValue);
    }
}

I hope this helps.

Regards,
Alexander
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
gabi
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or