Numeric datatypes

4 posts, 0 answers
  1. Jason Parrish
    Jason Parrish avatar
    86 posts
    Member since:
    Sep 2009

    Posted 17 Nov 2011 Link to this post

    I have noticed both in the demo and my own test code that if a property is any numeric type, the max value is 100.  How do I control this?

    Also, I noticed that on the validating, the data types of the OldValue and NewValue are not the same, e.g.  OldValue is Integer but NewValue is Decimal.

  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    692 posts
    Member since:
    Sep 2012

    Posted 21 Nov 2011 Link to this post

    Hello Jason Parrish,

    Thank you for writing.

    You can edit the properties of the spin editor in the RadPropertyGrid EditorInitialized event. Here is a code snippet which demonstrates this:

    private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
    {
      PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor;
     
      if (editor != null)
      {
        editor.MaxValue = 200;
      }
    }

    The reason for the NewValue and old value to be of different types is that the old value is the value of the property and the new value is taken form the editor. And since we have one editor for all numeric types there will be differences. 

    I hope this explains things. Should you have further questions I would be happy to help. Greetings,
    Ivan Petrov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  3. Jason Parrish
    Jason Parrish avatar
    86 posts
    Member since:
    Sep 2009

    Posted 21 Nov 2011 Link to this post

    Thank you.  I already added similar code for that.  

    However, I would like to suggest the control automatically defaults to the MinValue and MaxValue when the datatype is a value type.

  4. Ivan Petrov
    Admin
    Ivan Petrov avatar
    692 posts
    Member since:
    Sep 2012

    Posted 22 Nov 2011 Link to this post

    Hi Jason Parrish,

    Thank you for writing back.

    This seems as a pretty reasonable idea. I have logged the idea into our Public Issue Tracking System - PITS. You can track the progress of this feature and vote it up on the following link - PITS Feature.

    I have also updated your telerik points for the good suggestion.

    All the best,
    Ivan Petrov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top