private void DataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
//我DataGrid绑定的是List<PracticeInfo>
//每个Item则是一个PracticeInfo对象
//根据自己绑定的对象进行修改
PracticeInfo pra = e.Row.Item as PracticeInfo;
if(pra != null)
{
//我这里是根据Order字段作为条件,Order等于“基层”则此行不可编辑
//根据自己的需求进行调整
if(pra.Order.Equals("基层"))
{
e.Row.IsEnabled = false;//行不可编辑
}
}
}