DataRow[] dr_ChartSource = dt_GridSource.Select("[구분] = '합계'");
DataTable dt_ChartSource = new DataTable();
dt_ChartSource = dt_GridSource.Clone();
foreach ( DataRow dr in dr_ChartSource )
{
DataRow tr = dt_ChartSource.NewRow();
for ( int j = 0 ; j < dr.Table.Columns.Count ; j ++ )
{
tr[j] = dr[j];
}
dt_ChartSource.Rows.Add(tr);
}
또는
DataRow[] dr_ChartSource = dt_GridSource.Select("[구분] = '합계'");
DataTable dt_ChartSource = new DataTable();
dt_ChartSource = dt_GridSource.Clone();
foreach ( DataRow dr in dr_ChartSource )
{
DataRow tr = dt_ChartSource.NewRow();
tr.ItemArray = dr.ItemArray;
dt_ChartSource.Rows.Add(tr);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////