PDA

View Full Version : حذف با علامت زدن چک لیست



zahra313
جمعه 29 آبان 1394, 13:13 عصر
باسلام.من میخوام سطرهایی رو که چک لیست هاشونو علامت میزنم با هم حذف کنم ولی با این کدی که نوشتم نمیشه.کسی میتونه کمکم کنه؟

for (int index = 0; index < GrvLecture.RowCount; index++)
{
DataGridViewCheckBoxCell chk = GrvLecture["Del", index] as DataGridViewCheckBoxCell;
if (chk != null)
if (chk.Value != null)
{
bool checkSate = (bool) chk.Value;
if (checkSate)
{
t_LecturesBindingSource.RemoveAt(index);
t_LecturesTableAdapter.Update(this.projectDataSet. T_Lectures);
}
}
}

Mahmoud.Afrad
جمعه 29 آبان 1394, 19:40 عصر
در حلقه از آخرین اندیس شروع به پیمایش کنید.