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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:12:36+00:00 2026-05-22T12:12:36+00:00

I have a DataGridView and I am populating it through a DataTable . On

  • 0

I have a DataGridView and I am populating it through a DataTable. On initializing, I add DataColumns to the DataTable and then set the DataSource of the DataGridView to the DataTable. Here is the code:

DataTable mTable    = new DataTable("Test");

DataColumn  col = new DataColumn;
col.DataType      = System.Type.GetType("System.Boolean");
col.ColumnName  = "First";
col.ReadOnly    = false;
mTable.Columns.Add(col);

col            = new DataColumn;
col.DataType    = System.Type.GetType("System.String");
col.ColumnName  = "Second";
col.ReadOnly    = false;
mTable.Columns.Add(col);

this.myGridView.DataSource = mTable;

This works fine however, I want to make one of the columns showup as a combobox. I think I have to do something with the Column’s datatype but I am not sure how to do this. Can anyone give me any pointer towards this?

  • 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-22T12:12:37+00:00Added an answer on May 22, 2026 at 12:12 pm

    This is old, but I thought I’d try to answer it anyways since I had the same question myself a while ago.

    First of all, you cannot make a DataTable column of type DataGridViewComboBoxColumn. DataColumn inherits from System.Data, while DataGridView*Columns inherit from System.Windows.Forms.

    What you can try is this: Once your DataTable is bound to your DataGridView, the columns from the DataTable should show up on the DataGridView in the designer. If you then expand the Columns property of your DataGridView, you should see your columns from your DataTable have been added to the list. Select the column that you want, and in the right-hand pane there will be a property called ‘ColumnType’. The default type is DataGridViewTextBoxColumn, but you can change it to DataGridViewComboBoxColumn.

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

Sidebar

Related Questions

I have a DataGridView with its datasource set to a generic list of custom
I am populating one DataGridView in C# windows application. I have one DataTable in
I have DataGridView and DataTable with my players. DataTable dt = Extensions.ToDataTable<Player>(PlayerList); Grid.DataSource =
I have a datagridview which is initially bound to an empty datatable. Then the
At present i have a the following code populating a datagridview showing the user
I have a datagridview which im binding DataTable to. What I want do is
I have a DataGridView which I add data to programatically. I have the AutoSizeRowsMode
I have a DataGridView which I am populating from a list of objects. However
Hi I have DataGridView control that I manyally fill with items (no DataSource) like
I have a datagridview that accepts a list(of myObject) as a datasource. I want

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.