با سلام.
تو ویندوز اپلیکیشن بلدم و این کار رو کردم. الان تو Asp.net web from همونجوری که درخواست من هست، تو هر ردیف، وقتی ردیفی داره Select میشه و کاربر یکی از ستون های بله یا خیر رو انتخاب میکنه، اگر بله رو انتخاب کرد گزینه خیر UnCheck بشه و برعکسش اگر گزینه خیر رو انتخاب کرد گزینه بله UnChecke بشه. من اینو از دوستان میخوام راهنمایی کنم.
در ویندوز اپلیکیشن یک پراپرتی داره که میشه باهاش این کار رو کرد که کدش این هست:
private void dgvCheckList_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (dgvCheckList.CurrentRow.Cells[5].Value != null && (bool)dgvCheckList.CurrentRow.Cells[5].Value && dgvCheckList.CurrentRow.Cells[6].Value == null)
{
dgvCheckList.CurrentRow.Cells[5].Value = true;
dgvCheckList.CurrentRow.Cells[5].Value = null;
dgvCheckList.CurrentRow.Cells[6].Value = false;
}
else if (dgvCheckList.CurrentRow.Cells[5].Value == null && dgvCheckList.CurrentRow.Cells[6].Value != null && (bool)dgvCheckList.CurrentRow.Cells[6].Value)
{
dgvCheckList.CurrentRow.Cells[6].Value = true;
dgvCheckList.CurrentRow.Cells[6].Value = null;
dgvCheckList.CurrentRow.Cells[5].Value = false;
}
else if (dgvCheckList.CurrentRow.Cells[5].Value == null && dgvCheckList.CurrentRow.Cells[6].Value == null)
{
dgvCheckList.CurrentRow.Cells[5].Value = false;
dgvCheckList.CurrentRow.Cells[6].Value = false;
}
else
{
dgvCheckList.CurrentRow.Cells[5].Value = false;
dgvCheckList.CurrentRow.Cells[6].Value = false;
}
}
الان واسه وب فرم همچین پراپرتی واسه GridView نداره.