C# 如何在c语言中对datagridview中的数据进行降序排序#

C# 如何在c语言中对datagridview中的数据进行降序排序#,c#,sorting,datagridview,C#,Sorting,Datagridview,所以我想把我的txtCourse和txtTimeslot填入datagridview, 然后对txtTimeslot进行降序排序,并在datagridview中显示txtCourse和txtTimeslot string firstColum = txtCourse.Text; string secondColum = txtTimeslot.Text; string[] row = { firstColum, secondColum }; dgvLSD.Rows.Add(row); 我已将

所以我想把我的txtCourse和txtTimeslot填入datagridview, 然后对txtTimeslot进行降序排序,并在datagridview中显示txtCourse和txtTimeslot

string firstColum = txtCourse.Text;
string secondColum = txtTimeslot.Text;
string[] row = { firstColum, secondColum };

dgvLSD.Rows.Add(row);
我已将txtCourse和txtTimeslot填充到datagridview中

string firstColum = txtCourse.Text;
string secondColum = txtTimeslot.Text;
string[] row = { firstColum, secondColum };

dgvLSD.Rows.Add(row);

我需要知道如何将txtTimeslot按降序排序,并将txtCourse和txtTimeslot显示在datagridview中

将列的
SortMode
属性设置为
Automatic
它已经处于自动模式
string firstColum = txtCourse.Text;
string secondColum = txtTimeslot.Text;
string[] row = { firstColum, secondColum };

dgvLSD.Rows.Add(row);