我试图根据该行中的值禁用 RadGridView 行?我在 RowLoaded 事件中尝试了以下代码,但它似乎禁用了所有行。
var isEnrolled = (from c in masterList
where c.StudentId == StudentID
where c.Rolls[0].RollId == item.RollId.ToString()
select c.IsEnrolled).FirstOrDefault();
if (isEnrolled)
e.Row.IsEnabled = false;
是否可以在同一事件中完成,因此如果一行包含“已确认”一词,则该行被禁用?
foreach(DataGridRow item in RollListGrid.Items)
{
//Disable row if it contains "Confirmed"
}
还有一个,如果查询返回true,我如何检查一行中的复选框?
var isProspectiveStudent = (from c in masterList
where c.StudentId == StudentID
where c.Rolls[0].RollId == item.RollId.ToString()
select c.IsProspectiveStudent).FirstOrDefault();
if (isProspectiveStudent){
//Check the relevant checkbox
}
谢谢!!