Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:14:29+00:00 2026-05-10T15:14:29+00:00

I have a Property Grid in C#, loading up a ‘PropertyAdapter’ object (a basic

  • 0

I have a Property Grid in C#, loading up a ‘PropertyAdapter’ object (a basic wrapper around one of my objects displaying relevant properties with the appropriate tags)

I have a TypeConverter on one of the properties (DataType, that returns an enumeration of possible values) as I want to limit the values available to the property grid to Decimal and Integer, with the 2 methods as follows

public override bool GetStandardValuesSupported(ITypeDescriptorContext context) {     return true; }  public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {     return new StandardValuesCollection(new List<Constants.DataTypes>() { Constants.DataTypes.Decimal, Constants.DataTypes.Integer }); } 

This is displaying just as I want it on the property grid, and when I double click the property field in the property grid, it happily switches between Integer and Decimal. Similarily I can use the mouse wheel to scroll through the options in the property filed’s combobox.

If I however use the property field as a Combo Box and select a value from the drop-down, I get the standard property grid error box with the error:

Object of type ‘System.String’ cannot be converted to type ‘Pelion.PM3.Utils.Constants+DataTypes’.

I am assuming I can use the Converter overrides in the Type converter to trap these and convert them to an Enum of DataTypes, but why would the property grid fail when I select from the drop-down instead of double clicking or ‘mouseewheeling’ on the drop down?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:14:30+00:00Added an answer on May 10, 2026 at 3:14 pm

    When selected from the combo box drop down, the value is returned as string. I am not sure why that is, but I’ve seen in happen before. I think that basically double clicking or scrolling the mousewheel changes values from the value collection, while selecting from the drop down is like editing the field value as a string. Then, you have the convert the value from a string to the enum value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think the issue is that you're trying to cast… May 11, 2026 at 8:32 pm
  • Editorial Team
    Editorial Team added an answer Let's deconstruct the error you get: ActionView::TemplateError (undefined method `controls'… May 11, 2026 at 8:32 pm
  • Editorial Team
    Editorial Team added an answer External XML files are loaded with the URLLoader: var loader:URLLoader… May 11, 2026 at 8:32 pm

Related Questions

I have a Property Grid in C#, loading up a 'PropertyAdapter' object (a basic
We're working on an hospital information system that is being written on C# and
I have a really simple WPF UserControl: <UserControl x:Class=dr.SitecoreCompare.WPF.ConnectionEntry xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Name=connEntry BorderBrush=Navy BorderThickness=1
I have a ListBox, that's bound to an ObservableCollection . Each ListBoxItem is displayed
I have successfully set up a WPF Datagrid with the March 2009 WPF Toolkit

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.