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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:51:50+00:00 2026-05-27T20:51:50+00:00

It seems I am missing something from my code below: DataTable dt = new

  • 0

It seems I am missing something from my code below:

 DataTable dt = new DataTable();
 DataColumn dt_col_project_id = new DataColumn("Project ID", typeof(Int32));
 DataColumn dt_col_activate = new DataColumn("On/Off", typeof(bool));
 DataColumn dt_col_nature = new DataColumn("Nature", typeof(String));
 DataColumn dt_col_name = new DataColumn("Circle List", typeof(String));
 DataColumn dt_col_keywords = new DataColumn("Keywords", typeof(String));
 DataGridViewComboBoxColumn dt_col_automation = new DataGridViewComboBoxColumn();

                //setup combobox                        
                dt_col_automation.HeaderText = "Automation";
                dt_col_automation.Name = "dgv_jobs_col_automation";
                    dt_col_automation.Items.AddRange(
                        "Once every 5 minutes",
                        "Once every 10 minutes",
                        "Once every 15 minutes",
                        "Once every 30 minutes",
                        "Once every hour",
                        "Once every 2 hours",
                        "Once every 3 hours",
                        "Once every 4 hours",
                        "Once every 5 hours",
                        "Once every 6 hours",
                        "Once every 7 hours",
                        "Once every 8 hours",
                        "Once every 9 hours",
                        "Once every 10 hours",
                        "Once every 11 hours",
                        "Once every 12 hours",
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8",
                        "9",
                        "10",
                        "11",
                        "12",
                        "13",
                        "14",
                        "15",
                        "16",
                        "17",
                        "18",
                        "19",
                        "20",
                        "21",
                        "22",
                        "23",
                        "24"
                    );



                    dt.Columns.Add(dt_col_project_id); // Create a string column dynamically
                    dt.Columns.Add(dt_col_activate); // Create a string column dynamically
                    dt.Columns.Add(dt_col_nature); // create an int column dyn
                    dt.Columns.Add(dt_col_name); // create a double column dyn
                    dt.Columns.Add(dt_col_keywords); // create a double column dyn
                    dt.Columns.Add(dt_col_automation); // create a double column dyn

Because it’s throwing these exceptions. What am I doing wrong?

enter image description here

  • 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-27T20:51:51+00:00Added an answer on May 27, 2026 at 8:51 pm

    You are trying to add a combobox column to the DataTable that is bound to the GridView, not the Gridview itself. DataGridViewComboBoxColumn does not inherit from DataColumn, you need to set up the columns in the GridView, not on the DataTable.

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

Sidebar

Related Questions

I feel like I am missing something - from what it seems, JSP comes
This seems very basic and I must be missing something, but here goes anyways...
Now I must be missing something here, as this seems a very basic issue
I'm probably missing out on something fundamental here but it seems rather tricky and
Using Windows Mobile 6.5 and C# The CharacterCasing property seems to be missing from
I am grabbing some data from a page using the code below: int clientId
I'm missing something elementary here when debugging some .NET code: public static void CreateServiceSessionStore()
I seem to be missing something about LINQ. To me, it looks like it's
I seem to be missing something obvious here, why would I want more than
The JFileChooser seems to be missing a feature: a way to suggest the file

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.