使用随机安装示例进行测试,测试所用Deom路径:
\Documents\ComponentOne Samples\WPF\C1.WPF.DataGrid\CS\DataGridSamples\DataGrid
添加如下代码,没有重现不起作用的问题:
- private void grid_AutoGeneratingColumn(object sender, C1.WPF.DataGrid.DataGridAutoGeneratingColumnEventArgs e)
- {
- Common.HandleColumnAutoGeneration(e);
- if (e.Property.Name == "Name" && e.Column is C1.WPF.DataGrid.DataGridBoundColumn)
- {
- e.Column.Width = new C1.WPF.DataGrid.DataGridLength(50, DataGridUnitType.AutoStar);
-
- }
- }
复制代码
|
|