zahra313
جمعه 29 آبان 1394, 14: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);
}
}
}
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);
}
}
}