Home Forums WinForms controls Xceed Grid for WinForms Copying grid takes too long Reply To: Copying grid takes too long

User (Old forums)
Member
Post count: 23064

You should really use a StringBuilder instead of constantly appending strings. Like this:
<pre>StringBuilder b = new StringBuilder();
foreach(Row row in rl)
{
Xceed.Grid.DataRow dataRow = row as Xceed.Grid.DataRow;
if (dataRow != null)
{
foreach(Cell cell in dataRow.Cells)
{
if (cell.Visible)
b.Append(cell.Value.ToString() + “\t”);
}
b.AppendLine();
}
}
data.SetData(DataFormats.Text, b.ToString());</pre>

Imported from legacy forums. Posted by Tommy (had 2975 views)