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

FlagEnumEditor can't handle int64 flag enums

3 Answers 84 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
SPARE GmbH
Top achievements
Rank 2
SPARE GmbH asked on 10 Jul 2012, 10:39 AM
I have a flag enum that contains more than 32 flags so I set the underlying type to be long (Int64). When I set the RadPropertyGrid.Item to an object which has a long flags property, I get an OverflowException: "Value was either too large or too small for an Int32." (originating at Telerik.Windows.Controls.Data.PropertyGrid.FlagEnumEditor.OnEnumTypePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) ).

Is there a way for the property grid to deal with enums whose underlying type is Int64 (or some other type > 32bit)?

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 10 Jul 2012, 11:37 AM
Hello Alfred,

Will it be possible to share your definition of flag enum as I have tested it on my side and I could not get the exception you mentioned ?  

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
SPARE GmbH
Top achievements
Rank 2
answered on 10 Jul 2012, 11:42 AM
Hi Maya,

Sure

[Flags]
    public enum MFSFlags : ulong
    {
        None                        = 0x00000000,
 
        GF_STANDARD                 = 0x00000001,
        GF_VISIBLE                  = 0x00000002,
        GF_DISABLED                 = 0x00000004,
        GF_BORDER                   = 0x00000008,
        GF_3DSTYLE                  = 0x00000010,
        GF_POSABS                   = 0x00000020,
        GF_SCOLLBAR                 = 0x00000040,
        GF_EVENT                    = 0x00000080,
        GF_GRPELEMENT               = 0x00000100,
        GF_AUTOSIZE                 = 0x00000200,
        GF_NOATTACHMENT             = 0x00000400,
        GF_ATTACHMENTBG             = 0x00000800,
        GF_QUERYLOV                 = 0x00001000,
        GF_PRINTTOGETHER            = 0x00002000,
        GF_NOPRINT                  = 0x00004000,
        GF_NOPRINTBORDER            = 0x00008000,
        GF_DISPLAYNULL              = 0x00010000,
        GF_RIGHTOF                  = 0x00020000,
        GF_TABSTOP                  = 0x00040000,
        GF_NOACCES                  = 0x00080000,
 
        CF_KREUZ                    = 0x00100000,
        CF_HAKEN                    = 0x00200000,
        CF_RECHTECK                 = 0x00400000,
        CF_FUELLRECHT               = 0x00800000,
 
        CF_MULTISELECT              = 0x01000000,
 
        MF_BOX                      = 0x02000000,
        MF_COMB                     = 0x04000000,
        MF_UNFRAMED                 = 0x08000000,
        MF_UNDERLINE                = 0x10000000,
 
        RF_SPELL_CHECK_BACKGROUND   = 0x20000000,
 
        PB_STYLED                   = 0x40000000,
 
        GF_BORDERSTATIC             = 0x80000000,
        GF_SCROLLBAR                = 0x0000000100000000,
        CG_EXPANDED                 = 0x0000000200000000,
        DF_NOAUTOCOLUMNS            = 0x0000000400000000,
        DF_AUTOHEADINSERT           = 0x0000000800000000,
        DF_MANQUERY                 = 0x0000001000000000
    }

Greetings

Alfred
0
Maya
Telerik team
answered on 10 Jul 2012, 11:55 AM
Hi Alfred,

Indeed, you are quite right. I managed to reproduce the issue and the fix will be available in our next internal build.
I have updated your Telerik points accordingly. 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PropertyGrid
Asked by
SPARE GmbH
Top achievements
Rank 2
Answers by
Maya
Telerik team
SPARE GmbH
Top achievements
Rank 2
Share this question
or