如何在radiobutton checkchanged上对datagridview列进行排序?当我尝试下面的代码时,会引发异常
private void rdoBookedOn_CheckedChanged(object sender, EventArgs e)
{
DataGridViewColumn bkon = grdBookingView.Columns[3];
grdBookingView.Columns[3].SortMode = DataGridViewColumnSortMode.Programmatic;
this.grdBookingView.Sort(this.bkon, ListSortDirection.Descending);
}
此行引发了ArgumentException
this.grdBookingView.Sort(this.bkon, ListSortDirection.Descending);
我在设计师中试过这个
this.grdBooking.AutoGenerateColumns = false;
gridview的截图