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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:20:37+00:00 2026-06-05T13:20:37+00:00

I am trying to update my DataGrid but unfortunately not able to! My application

  • 0

I am trying to update my DataGrid but unfortunately not able to! My application have a DataGrid to which data is loaded from a CSV file. Some of the data needs to get updated. But I am not able to find the right way to reflect the updates on the grid.

Here is what I have so far:

// Creation of my DataGrid
this.dataSource = new DataSet();
DataTable data = new DataTable("Products");    


data.Columns.Add("Note", System.Type.GetType("System.String"));
data.Columns.Add("Details", System.Type.GetType("System.String"));
data.Columns.Add("Net", System.Type.GetType("System.String"));
data.Columns.Add("Empty Weight", System.Type.GetType("System.String"));
data.Columns.Add("Full Weight", System.Type.GetType("System.String"));
data.Columns.Add("Description", System.Type.GetType("System.String"));
data.Columns.Add("UOM", System.Type.GetType("System.String"));
data.Columns.Add("Item", System.Type.GetType("System.String"));

dataSource.Tables.Add(data);
dataGrid1.DataSource = data;

When User press a “Load” button, I load the data to my grid:

DataTable vehicle = dataSource.Tables[0];
.
. // data is read from CSV
.
vehicle.Rows.Add("A sample note", "...", full - empty, empty, full, "Test description", "Gr", i); // an example

Here is how I tried to update the data on the grid:

DataTable vehicle = dataSource.Tables[0];
vehicle.Rows[0].BeginEdit();
vehicle.Rows[0].ItemArray[0] = "TEST COMPLETE";            
vehicle.Rows[0].EndEdit();
vehicle.AcceptChanges();
dataGrid1.Update();

But there is no update to the grid.. What am I missing?

  • 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-05T13:20:41+00:00Added an answer on June 5, 2026 at 1:20 pm

    For developers facing the same issue, here is how I fixed mine:

    You can make use of the SetField method to update the data in the Grid’s row. Assuming that you have the row index to modify in variable currentRow, there is how I modified my data:

    DataTable vehicle = dataSource.Tables[0];
    vehicle.Rows[this.currentRow].SetField(4, "Updating the 5th column in the grid");
    vehicle.Rows[this.currentRow].SetField(2, "Updating the 3rd column in the grid");
    

    If you need to remove the row from the grid, you can make use of the RemoveAt method:

    dataGridTable.Rows.RemoveAt(rowIndexToDelete);  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to update a database with values from a csv file, the
I'm trying to update a combobox/datagrid sorter that came from flex3 to a flex4
I am trying to display data in an MVC3 application that shows data from
I have an application where I'm trying to update the String for a Label's
I trying to update a model on a callback but the validation is causing
When trying to update a subversion working copy from Netbeans, I get the following
I have a Silverlight 2 application that validates data OnTabSelectionChanged. Immediately I began wishing
I am trying to build my first CRUD application and cant get the update
I am trying to build an silverlight application which takes user first name, last
Trying to update a table on a linked server (SQL 2000/2005) but my server

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.