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 579297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:21:07+00:00 2026-05-13T14:21:07+00:00

In my database I have a 2 columns (Kind and Priority) that are of

  • 0

In my database I have a 2 columns (Kind and Priority) that are of type int. I also have an enum with the values of Kind and Priority. But when I try to display them into a GridViewColumn, it shows the integers and not the enum values. Do I need a converter Here is the enums:

public enum Kind
{
    None = 0,
    Task = 1,
    Assignment = 2,
    Quiz = 3,
    Test = 4,
    Exam = 5,
    Project = 6,

}
public enum Priority
{
    None = 0,
    Low = 1,
    Medium = 2,
    High = 3,
    Top = 4,
}

And my XAML:

<GridViewColumn x:Name="PriorityColumn" Header="Priority" Width="60" DisplayMemberBinding="{Binding Path=Priority}" />
<GridViewColumn x:Name="KindColumn" Header="Kind" Width="60" DisplayMemberBinding="{Binding Path=Kind}" />
  • 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. Editorial Team
    Editorial Team
    2026-05-13T14:21:08+00:00Added an answer on May 13, 2026 at 2:21 pm

    If the Priority and Kind properties are declared as type int, then yes, you will need a converter. WPF has no way of knowing that the properties declared as integer need to be interpreted as values from the enums.

    If the Priority and Kind properties are declared as type Priority and Kind respectively, then it should just work: WPF displays enums by calling ToString() on them which will result in the name of the enum value.

    For example:

    // As per your question
    public enum Kind { ... }
    public enum Priority { ... }
    
    // Your database object
    public class Job : INotifyPropertyChanged
    {
      public Kind Kind { get ... set ... }             // note Kind not int
      public Priority Priority { get ... set ... }     // note Priority not int
    }
    

    (When populating a Job object you will of course need to cast the ints coming out of the database to Kind and Priority, or you stick with an int backing field and do the casting in the getter and setter. If you are using a good ORM then it should be able to take care of this for you.)

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

Sidebar

Related Questions

I'm new to database indexing, if I have 2 columns in a table that
I have a database that has four columns like this level_1, level_2, level_3, level_4
In my database, I have a few columns in one of my tables that
I have a table in my Postgres database with columns named type, desc, and
I have a database column WantsReply that logically holds a boolean (bit) but is
I have a field in my table with name (Kind) .it's type is int
I've just come across a database where all the character based columns have their
I have a database table named call with columns call_time, location, emergency_type and there
If I have a database containing only varchar columns, with strings encoded in Latin-1
I have two tables in my database: NEWS table with columns: id - the

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.