Decimal User Input

7 posts, 0 answers
  1. Richard Harrigan
    Richard Harrigan avatar
    235 posts
    Member since:
    Nov 2009

    Posted 27 Feb 2011 Link to this post

    Hi,

    I have a grid column that is type Decimal with a currency DataFormatString. When I try to filter on that column it does not allow me to enter a decimal point.  I saw in the first look demo that it works. Any ideas?

    Thanks
    Rich
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 28 Feb 2011 Link to this post

    Hi Richard Harrigan,

    We are a little bit confused.

    Are you referring RadGridView column filtering or RadDataFilter, because you mention a grid column and the support ticket category is RadDataFilter? Let us know which one is it.

    Best wishes,
    Ross
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Richard Harrigan
    Richard Harrigan avatar
    235 posts
    Member since:
    Nov 2009

    Posted 28 Feb 2011 Link to this post

    My problem is with the DataFilter which uses as it's source RadGridView.
    RadDataFilter.Source = RadGridView.Items

    Thanks
    Rich
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 28 Feb 2011 Link to this post

    Hello Richard Harrigan,

    In this case can you try the following.

    1. Attach to the EditorCreated event of RadDataFilter.
    2. In the event handler, check the name of the property for which the editor has been created.
    3. In case this is your decimal property, cast the editor to RadMaskedTextBox and set its mask to "f". Something like this:

    void radDataFilter_EditorCreated(object sender, Telerik.Windows.Controls.Data.DataFilter.EditorCreatedEventArgs e)
    {
        if (e.ItemPropertyDefinition.PropertyName == "MyDecimalProp")
        {
            var editor = e.Editor as RadMaskedTextBox;
            if (editor != null)
            {
                editor.Mask = "f";
            }
        }
    }

    Meanwhile, I will fix this so that the default editor is created with the "f" mask by default when the type of the property is decimal.

    I hope this helps.

    Kind regards,
    Ross
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  6. Richard Harrigan
    Richard Harrigan avatar
    235 posts
    Member since:
    Nov 2009

    Posted 28 Feb 2011 Link to this post

    Worked great!

    Thanks
    Rich
  7. Niranjan
    Niranjan avatar
    3 posts
    Member since:
    Feb 2011

    Posted 08 Mar 2011 Link to this post

    I am using the following RadMaskedTextBox.

    <

     

     

    telerik:RadMaskedTextBox MaskType="Numeric" Mask="c" EmptyContent="Some vaule"

    When i enter values inside the textbox it is formatted in the Currency format say $37.00. But when i delete the values i am getting $0.00 and the value of the textbox is set to this. Will the values not be deleted on pressing backspace and Null value set when all the entries are deleted.

    Also when the textbox is having only the EmptyContent and when i straight away enter .(decimal point), I am getting Object Reference not to set to instance of the Object.

    Is there something that i am missing?

  8. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 11 Mar 2011 Link to this post

    Hi Richard Harrigan,

    The masked text box does not support null values, so you will not be able to delete the value inside it completely. It will default to 0.00 instead. The second issue is a known one. You can try the new RadMaskedCurrencyInput control where these scenario is covered.

    Greetings,
    Alex Fidanov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
DevCraft banner