回复 12楼shayne的帖子
你好,经过和产品组确认,建议使用CreateCellEditor代替CreateCell。
根据你之前的需求,代码参考如下:
- public class MyCellFactory : C1.WPF.FlexGrid.CellFactory
- {
- public override FrameworkElement CreateCellEditor(C1.WPF.FlexGrid.C1FlexGrid grid, C1.WPF.FlexGrid.CellType cellType, C1.WPF.FlexGrid.CellRange rng)
- {
- var _frameworkElement = base.CreateCellEditor(grid, cellType, rng);
- if (cellType == C1.WPF.FlexGrid.CellType.Cell)
- {
- if (grid.Columns[rng.Column].ColumnName.Equals("CreateTime"))
- {
- var bdr = _frameworkElement as Border;
- C1DatePicker dp = new C1DatePicker();
- dp.Tag = rng;
- bdr.Child = dp;
- }
- }
- return _frameworkElement;
- }
- }
复制代码
请再次尝试同样的操作步骤。 |