private void tsmNoRight_Click(object sender, EventArgs e) { //главная задача drivers = drivers.ListDriveCar(ModDrive.No); drivers.GetList().Sort(); dgMain.Rows.Clear(); dgMain.DataSource = drivers.GetList(); }
private void cmbSort_SelectedIndexChanged(object sender, EventArgs e) { switch (cmbSort.SelectedItem) //это не красиво { case "Все": drivers = drivers.ListDriveCar(ModDrive.All); drivers.GetList().Sort(); dgMain.DataSource = drivers.GetList(); break; case "Может": canDrivers = drivers.ListDriveCar(ModDrive.Yes); canDrivers.GetList().Sort(); dgMain.DataSource = canDrivers.GetList(); break; case "Не может": notCanDrivers = drivers.ListDriveCar(ModDrive.No); notCanDrivers.GetList().Sort(); dgMain.DataSource = notCanDrivers.GetList(); break; } }