muratboy31 Posted June 14, 2015 Share Posted June 14, 2015 Arkadaşlar merhaba, aşağıdaki gibi bir kodum var çalışıyorda aslında sorunsuz ancak merak ettiğim bu kodu daha kısa nasıl yazabilirdim ; int j = 0; string sayi = ""; for (int i = 0; i < gridView1.RowCount; i++) { sayi = gridView1.GetDataRow(i)["Seç"].ToString(); if (sayi == "True") { j++; } } if (j > 0) { if (XtraMessageBox.Show("Seçili kayıtları silmek istediğinizden emin misiniz ?", "Kayıt Sil", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { string value = ""; for (int i = 0; i < gridView1.RowCount; i++) { value = gridView1.GetDataRow(i)["Seç"].ToString(); if (value == "True") { Kayit_Sil(Convert.ToInt32(gridView1.GetRowCellValue(i, gridView1.Columns["ID"]).ToString())); } } Yenile(); } } Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted June 14, 2015 Editor Share Posted June 14, 2015 Üstteki for döngüsünün içinde yapabilirdin aynı işlemi Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.