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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:48:15+00:00 2026-06-13T14:48:15+00:00

By this way we can override datagridview col string: and put in this format

  • 0

By this way we can override datagridview col string: and put in this format Config1, Config2 etc….!

DataSet ds = new DataSet();
 ds.ReadXml(@"D:\test\a.xml");
 for (int i = 1; i <= ds.Tables[0].Rows.Count; i++)
  {
       ds.Tables[0].Rows[i - 1][0] = "Config" + i;
  }
  dataGridView1.DataSource = ds.Tables[0];

In my case, my datagridview col has already filled data from a xml file after that I want to override by above method (I’m not using any dataset to read xml file)

This is my approach & it’s completely wrong… any help??

private void writefunction()
{
        for (int i = 1; i <= dataGridView3.Columns["id"].Index; i++)
        {
            dataGridView3.Columns[i - 1][0] = "Config" + i;
        }
}
  • 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-13T14:48:16+00:00Added an answer on June 13, 2026 at 2:48 pm

    As far as I know, you cannot manually modify the contents of a GridView. To make any changes, you have to modify the corresponding data in the data source and bind the GridView again.

    To achieve what you are looking for, modify the value in the DataTable and set the DataSorce property of the GridView to modified DataTable and call DataBind method.

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

Sidebar

Related Questions

I'm trying to get edit text to behave in this way: User can input
in what way can this be programmed. a UI box that displays random number
In coffeescript we can do this way: rows = [ {a: 1} {b: 2}
I know I can use this way to find the most frequent element in
Not sure if I can do it this way. I want to get current
I can get the current selected row in this way: private void DataGridView1_CellContentClick(object sender,
I can define default value in domain by this way : class ProcessingPriority {
Okay I'll try describe this the best way I can. I have a chat
I can calculate the size of the files in a tarfile in this way:
This is the best way I can think of phrasing this question, given this

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.