private void btnIslem2_Click(object sender, EventArgs e) { if (btnIslem2.Text == "PASİFLER") { grdOgrenci.DataSource = Yardimci.Tablo(Yardimci.SilinenGoster()); grdOgrenci.Sort(grdOgrenci.Columns["ID"], ListSortDirection.Ascending); btnIslem2.Text = "AKTİFLER"; } else if (btnIslem2.Text == "AKTİFLER") { grdOgrenci.DataSource = Yardimci.Tablo(Yardimci.VeriGetirRapor()); grdOgrenci.Sort(grdOgrenci.Columns["ID"], ListSortDirection.Ascending); btnIslem2.Text = "PASİFLER"; } }
public void gerial() { foreach (DataGridViewRow row in grdOgrenci.Rows) { if (row.Cells[0].Value != null && row.Cells[0].Value.Equals(true)) { row.Selected = true; row.DefaultCellStyle.SelectionBackColor = Color.LightSlateGray; } else { row.Selected = false; } } foreach (DataGridViewRow row in grdOgrenci.Rows) { if (row.Selected == true) { string b = row.Cells[1].Value.ToString(); Yardimci.Tablo(Yardimci.GeriAl(b)); } else { continue; } } grdOgrenci.DataSource = Yardimci.Tablo(Yardimci.SilinenGoster()); //grdOgrenci.DataSource = Yardimci.Tablo(Yardimci.GeriAl(satir)); //grdOgrenci.DataSource = Yardimci.Tablo(Yardimci.SilinenGoster()); lblKayitBasarili.Text = "GERİ ALINDI"; time(); }