How can I set the binding of a DataGridTextColumn in code?

前端 未结 3 816
执念已碎
执念已碎 2021-02-19 18:45

I\'m using the toolkit:DataGrid from CodePlex.

I\'m generating the columns in code.

How can I set the equivalent of {Binding FirstName} in code?

3条回答
  •  自闭症患者
    2021-02-19 19:06

    Example:

    DataGridTextColumn dataColumn = new DataGridTextColumn();
    dataColumn.Header = "HeaderName";
    dataColumn.Binding = new Binding("HeaderBind");
    dataGrid.Columns.Add(dataColumn); 
    

提交回复
热议问题