Shuffle/ReOrder DataTable Columns
private void ShuffleDataTableColumns(DataTable dt,string columnList)
{
int columnIndex = 0;
foreach (var columnName in columnList.Split(','))
{
if (dt.Columns[columnName] != null)
{
dt.Columns[columnName].SetOrdinal(columnIndex);
columnIndex++;
}
}
}
Comments
Post a Comment