我將一組對象綁定到DevExpress GridControl,並使用15.1 Data Annotations來自定義外觀。不過,我正在努力尋找關於設置一個屬性的列大小的任何事情。這可能通過註釋嗎?列寬的數據註釋
類具有註釋:
public class DataFeedback
{
[Display(Name = "Row Num", Order = 0)]
public int RowNum { get; set; }
[Display(Name = "Description", Order = 1)]
public string Desc { get; set; }
public DataFeedback(int rowNum, string desc)
{
RowNum = rowId;
Desc = desc;
}
}
簡單的綁定
var feedbackList = new List<DataFeedback>()
feedbackList.Add(new DataFeedback(1, "test"))
gridControl1.DataSource = feedbackList;
// only layout I've found so far
gridView1.BestFitColumns();
你嘗試過使用StringLengthAttribute嗎? – Overmachine