public void update() { gestionEmp = new ctrlEmploye(true); int Colum = gridEmploye.SortedColumn.Index; int Idselect = ((Employe)this.Tag).idEmp; ListSortDirection DD = ListSortDirection.Descending; if (gridEmploye.SortOrder == SortOrder.Ascending) DD = ListSortDirection.Ascending; gridEmploye.Rows.Clear(); chargeDonnee(); gridEmploye.Sort(gridEmploye.Columns[Colum], DD); int R = gestionEmp.RowsById(Idselect, gridEmploye); //gridEmploye.Rows[R].Cells[1].Selected = true; gridEmploye.Rows[R].Selected = true; }
public frmGesEmp(int F, int I, ListSortDirection S) { InitializeComponent(); gestionEmp = new ctrlEmploye(true); chargerColonnes(); btnDetails.Visible = true; btnRecherche.Visible = true; txtRecherche.Visible = true; btnX.Visible = true; btnDetails.Click += new EventHandler(btnDetails_Click); btnRecherche.Click += new EventHandler(btnRecherche_Click); btnX.Click += new EventHandler(btnX_Click); btnRejet.Click += new EventHandler(btnDesactiver_Click); btnRejet.Text = "Désactiver"; this.txtRecherche.KeyDown += new KeyEventHandler(txtRecherche_KeyDown); this.Text = "Texel : Gestion - Employés"; gridEmploye.Sort(gridEmploye.Columns[F], S); int R = gestionEmp.RowsById(I, gridEmploye); gridEmploye.Rows[R].Selected = true; gridEmploye.Rows[R].Cells[1].Selected = true; }