troubleshooting Question

Bulk Update of rows in data table in datagrid

Avatar of JeraldX
JeraldX asked on
C#
4 Comments1 Solution2271 ViewsLast Modified:
I have a datagrid which is connected to a datatable.
This datatable has got around 7000 rows. I want to update 3 columns in all the 7000 rows.
Currently I am using following code :

this.dataGrid1.DataSource = null;
                  
foreach(DataRow dr in DealsTable.Rows)
{
dr["MarketRate"] = "dummy";
dr["PandL"] = "dummy1";
dr["PandLUSD"] = "dummy2";
}
this.dataGrid1.DataSource = DealsView;

The foreach loop takes up lot of time. Is there  a way where I can do the bulk update of these rows ?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros