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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:25:37+00:00 2026-05-23T05:25:37+00:00

I have a set of data coming into a DataGridView from another DataGridView (

  • 0

I have a set of data coming into a DataGridView from another DataGridView (described here, question solved).

I now wish to add two new columns to my DataSet, one Integer, one Boolean, with the Integer column being of type DataGridViewNumericUpDownColumn (gratefully thieved from this MSDN page), and the Boolean column being of DataGridViewCheckBoxColumn type.

If I add the columns directly to the DataSet, I can’t seem to specify the DataGridViewColumn type for the Integer column.

If I set the DataSet as the DataSource of the DataGridView, then add the columns to the DataGridView, then the columns exist, but aren’t bound back to the DataSet, which does not contain those columns.

How do I get these two columns to bind to the DataGridViewColumns, with the correct column type?

  • 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-23T05:25:37+00:00Added an answer on May 23, 2026 at 5:25 am

    To do this you need to set the AutoGenerateColumns property of the DataGridView to false and add the columns yourself to both the DataSet and the DataGridView. DataGridView columns have the DataPropertyName property which allows you to set up binding to the underlying DataSource.

    What you can do is have the AutoGenerateColumns property set true, add the DataSet as the DataSource for the grid (thus getting most of your needed columns), then turn AutoGenerateColumns off and add the Integer and Boolean columns to the dataset and the grid.

    Below is some example code, binding against a DataTable:

    DataTable dataTable = new DataTable();
    
    DataColumn col1 = new DataColumn("Id",typeof(int));
    col1.AutoIncrement = true;
    
    DataColumn col2 = new DataColumn("Name",typeof(string));    
    DataColumn col3 = new DataColumn("TimeStamp",typeof(DateTime));
    
    dataTable.Columns.AddRange(new DataColumn[] { col1, col2, col3 }); 
    
    dataTable.Rows.Add(null,"John",DateTime.Now);    
    dataTable.Rows.Add(null,"Jane",DateTime.Now);         
    
    BindingSource source = new BindingSource();
    source.DataSource = dataTable;
    dataGridView1.DataSource = source;
    
    dataGridView1.AutoGenerateColumns = false;
    
    DataColumn col4 = new DataColumn("CheckCol", typeof(bool));
    dataTable.Columns.Add(col4);
    
    DataGridViewCheckBoxColumn dgvcol1 = new DataGridViewCheckBoxColumn();
    dgvcol1.DataPropertyName = "CheckCol";
    dgvcol1.Name = "Select";
    
    dataGridView1.Columns.Add(dgvcol1);
    

    I haven’t implemented the NumericUpDown column type, but it should work just the same as the check box column type shown.

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

Sidebar

Related Questions

In my application, I have URN-identified data coming in from the server. I'm in
I have data coming in from datastage that is being put in our SQL
We have this set of data that we need to get the average of
I have a set of data that models a hierarchy of categories. A root
I have a set of data protected by 16bit checksums that I need to
I have a set of data that needs to be displayed as a crosstab
I have a set of data points in 3D space which apparently all fall
I have a set of data and I want to find the biggest and
I have a set of data, with columns x and y. This set contains
I have a set of data that contains garbled text fields because of encoding

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.