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

  • Home
  • SEARCH
  • 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 8522513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:08:28+00:00 2026-06-11T07:08:28+00:00

I am currently working in C# window application. There I use data grid view

  • 0

I am currently working in C# window application. There I use data grid view combo box in the DataGridView. While clicking the drop down box it displays the Name field, if I select the name field from the drop box, it displays the value member value in DataGridView ComboBox.

Why I am not getting the display member value in the Combo box?

In databindindcomplete function I define the value for the ComboBox:

((DataGridViewComboBoxColumn)dgvItem_1.Columns["Student"]).DataSource = objDBContext.Stu_student;
((DataGridViewComboBoxColumn)dgvItem_1.Columns["Student"]).DisplayMember = "STUDENT_NAME";
((DataGridViewComboBoxColumn)dgvItem_1.Columns["Student"]).ValueMember = "STUDENT_ID";

If I select a value in the ComboBox following value displayed in drop down list

Name
—–
Raja
Ramesh
Rani

If I select Raja in the list the ComboBox displays the corresponding STUDENT_ID in the ComboBox. But I want to display the Student name in the ComboBox.

Can anyone tell me why I am getting the ValueMember value in the DataGridView ComboBox?

  • 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-06-11T07:08:30+00:00Added an answer on June 11, 2026 at 7:08 am

    So in my simple example where I’ve got a Student class that looks like:

    public class Student
    {
        public string Name { get; private set; }
        public int StudentId{ get; private set; }
        public Student(string name, int studentId)
        {
            Name = name;
            StudentId= studentId;
        }
    
        private static readonly List<Student> students = new List<Student>
        {
            { new Student("Chuck", 1) },
            { new Student("Bob", 2) }
        };
    
        public static List<Student> GetStudents()
        {
            return students ;
        }
    }
    

    and I set up my binding for the combobox like this:

            DataGridViewComboBoxColumn comboBoxColumn = (DataGridViewComboBoxColumn)dataGridView1.Columns[0];
            comboBoxColumn .DataSource = Student.GetStudents();
            comboBoxColumn .DisplayMember = "Name";  
            comboBoxColumn .ValueMember = "StudentId";        
    

    I get my student names in the dropdown and when I select one, the selected name shows up in the cell.

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

Sidebar

Related Questions

We are currently working on a data-driven state machine application. Right now, the state
I'm currently working on a console window in Swing. It's based on a JTextArea
When I start debugging the project we are currently working on, the program window
Currently working with the following package structure: /package __init__.py final.py /write __init__.py write.py /data
I am currently working on a WPF application where I would like to have
I am busy working on a mobile application that retrieves data from a web
I'm currently working on the user interface of a win forms application. The primary
I am currently working on the WPF project which involves creating a touch-screen application
I'm currently working with an existing application that defines a couple constants on the
I'm currently working with a rather old Borland C++ application, which is using an

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.