<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerdotstar.com/community" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>developer.* Blogs - Quick Fixes for SLOW DataGridView - Comments</title>
 <link>http://www.developerdotstar.com/community/node/706</link>
 <description>Comments for &quot;Quick Fixes for SLOW DataGridView&quot;</description>
 <language>en</language>
<item>
 <title>Another tip to speed up DataGridView</title>
 <link>http://www.developerdotstar.com/community/node/706#comment-9453</link>
 <description>&lt;p&gt;In unbound (non-Virtual) mode it&#039;s much faster to add all the rows at the beginning and then fill the cells than it is to add the rows one at a time inside the filling loop.&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;Rather than:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;
&lt;pre&gt;MaxRows = 10000&lt;br /&gt;For i = 0 to MaxRows - 1&lt;br /&gt;  dgv.Rows.Add()&lt;br /&gt;  dgv.Rows(i).Cells(0) = &amp;quot;Some Data&amp;quot;&lt;br /&gt;  dgv.Rows(i).Cells(1) = &amp;quot;Some More Data&amp;quot;&lt;br /&gt;Next i&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Use:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;
&lt;pre&gt;MaxRows = 10000&lt;br /&gt;dgv.Rows.Add(MaxRows)&lt;br /&gt;For i = 0 to MaxRows - 1&lt;br /&gt;  dgv.Row(i).Cells(0) = &amp;quot;Some Data&amp;quot;&lt;br /&gt;  dgv.Row(i).Cells(1) = &amp;quot;Some More Data&amp;quot;&lt;br /&gt;Next i&lt;/pre&gt;&lt;/div&gt;
</description>
 <pubDate>Sun, 06 May 2007 10:15:44 -0700</pubDate>
 <dc:creator>Steve</dc:creator>
 <guid isPermaLink="false">comment 9453 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Quick Fixes for SLOW DataGridView</title>
 <link>http://www.developerdotstar.com/community/node/706</link>
 <description>&lt;p&gt;After learning that you really don&#039;t want to try using the DataGridView in unbound mode (just get your data into a DataTable and let binding do the heavy lifting--binding doesn&#039;t suck anymore!), I had to next learn that the DataGridView can be really, really slow after you get more than a trivial amount of data in it. Here are a few tips.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.developerdotstar.com/community/node/706&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.developerdotstar.com/community/node/706#comment</comments>
 <category domain="http://www.developerdotstar.com/community/taxonomy/term/16">.NET</category>
 <pubDate>Wed, 07 Feb 2007 12:58:55 -0800</pubDate>
 <dc:creator>Daniel Read</dc:creator>
 <guid isPermaLink="false">706 at http://www.developerdotstar.com/community</guid>
</item>
</channel>
</rss>
