我想在detailView的DevExpress GridView中禁用列。现在,我可以通过以下代码在此视图中隐藏列,但不能将这些列设置为只读或未启用:
private void GridView_MasterRowExpanded(object sender, CustomMasterRowEventsArgs e)
{
var masterView = sender as GridView;
GridView detailView = masterView?.GetDetailView(e.RowHandle, e.RelationIndex) as GridView;
detailView?.Columns[0].Visible = false;
}
答案 0 :(得分:1)
private void GridView_MasterRowExpanded(object sender, CustomMasterRowEventsArgs e)
{
var masterView = sender as GridView;
GridView detailView = masterView?.GetDetailView(e.RowHandle, e.RelationIndex) as GridView;
//Make the column read-only
detailView?.Columns[0].OptionsColumn.ReadOnly = true;
//Make the column non-editable
detailView?.Columns[0].OptionsColumn.AllowEdit = false;
}