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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:21:09+00:00 2026-06-18T03:21:09+00:00

Seems like it’s so simple but for some reason working on it last 4

  • 0

Seems like it’s so simple but for some reason working on it last 4 hours with no result.
I have simple Gridview with two columns and few rows already filled, now I want to add ComboBoxCell to the next row.

I’ll show my logic and maybe you’ll show me my error:

SampleGridView.Rows.Add("test1", "test1");
SampleGridView.Rows.Add("test2", "test2");
SampleGridView.Rows.Add("test3", "test3");

works fine for three rows now I am inserting my ComboBox:

DataGridViewRow RowSample = new DataGridViewRow();
DataGridViewComboBoxCell  CellSample = new DataGridViewComboBoxCell();
CellSample.DataSource = StringList; // list of the items that I want to insert in ComboBox
RowSample.Cells.Add(CellSample);
SampleGridView.Rows.Add(RowSample);

Any ideas? Thank you

  • 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-18T03:21:10+00:00Added an answer on June 18, 2026 at 3:21 am

    figured it out 🙂 I was trying to insert ComboBox to the second cell of the row, and it didn’t work. I was trying to do it like this:

    SampleGridView.Rows.Add("CellText", RowSample);
    

    but it actually have to be like this

    DataGridViewRow RowSample = new DataGridViewRow();
    DataGridViewComboBoxCell  CellSample = new DataGridViewComboBoxCell();
    CellSample.DataSource = StringList; // list of the string items that I want to insert in ComboBox
    CellSample.Value = StringList[0]; // default value for the ComboBox
    DataGridViewCell cell = new DataGridViewTextBoxCell();
    cell.Value = "CellText"; // creating the text cell
    RowSample.Cells.Add(cell);
    RowSample.Cells.Add(CellSample);
    SampleGridView.Rows.Add(RowSample);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems like I may have missed something simple in the syntax, but I'd like
Seems like a simple issue but I'm obviously missing something. I have a ViewBag
Seems like this should be simple enough but for whatever reason I am unable
Seems like i need some help with a project. I have a routine ,
Seems like this should be simple, but powershell is winning another battle with me.
Seems like everyone always ignores the time part, but how would you compare two
seems like a simple question but I don't know JavaScript too well and my
Seems like this should be simple, but I don't find it in a net
Seems like a simple problem, but I can't find an answer. With cacheing disabled,
Seems like this is a dumb question, but I need something... substantial. I have

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.