gpt4 book ai didi

c# - Xtragrid 一栏可编辑其他不是

转载 作者:行者123 更新时间:2023-11-30 14:58:12 26 4
gpt4 key购买 nike

您好,我有 DevExpress xtragrid 控件。如何只为一列设置editable = true(列为空)

最佳答案

使用 GridColumn.OptionsColumn.AllowEdit属性:

// sample data
gridControl1.DataSource = new List<DataObj> {
new DataObj(){ Agent = "AMD" },
new DataObj(){ Agent = "!!!AMD" },
};
//...
gridView1.PopulateColumns();
foreach(GridColumn column in gridView1.Columns) // disable editing for all columns
column.OptionsColumn.AllowEdit = false;
gridView1.Columns["Description"].OptionsColumn.AllowEdit = true; // enable editing for specific column
//...
class DataObj {
public string Agent { get; set; }
public string Description { get; set; }
}

关于c# - Xtragrid 一栏可编辑其他不是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19674895/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com