pivot #1
Owner
```
void Pivot()
{
DataTable data = GetDataTableFromDGV(dataGridView1);
dataGridView1.Rows.Clear();
dataGridView1.Columns.Clear();
int iColSize = data.Columns.Count;
int iRowSize = data.Rows.Count - 1;
for (int i = 0; i < iRowSize; i++)
dataGridView1.Columns.Add("", "");
for (int iCol = 0; iCol < iColSize; iCol++)
{
int iRowIdx = dataGridView1.Rows.Add();
for (int iRow = 0; iRow < iRowSize; iRow++)
dataGridView1.Rows[iRowIdx].Cells[iRow].Value = data.Rows[iRow][iCol];
}
for (int i = 0; i < iRowSize; i++)
dataGridView1.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
}
```
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?