I’m trying to add rows to an unbound grid and the logic I have almost works, but it’s missing something. For example, if I select 5 rows and try to add them to another grid, it only adds 4. Here is my code:
<b>
gridControl1.BeginInit();
foreach (Xceed.Grid.DataRow myRow in gridControl2.SelectedRows)
{
// add to grid
Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
row.Cells[“TEST_NAME”].Value = myRow.Cells[“TEST_NAME”].Value;
row.Cells[“ALIQUOT_NAME”].Value = myRow.Cells[“ALIQUOT_NAME”].Value;
row.Cells[“TEST_ID”].Value = myRow.Cells[“TEST_ID”].Value.ToString();
}
gridControl1.EndInit();
</b>
If anyone sees anything wrong here please let me know.
Thanks in advance.
Imported from legacy forums. Posted by Nathan (had 1897 views)