0
orderBindingSource.DataSource = _orderEntity;
orderLineBindingSource.DataSource = _orderEntity.OrderLines;
xtraGridOrderLine.DataSource = orderLineBindingSource;

如何实现以下任务?

1/ 当用户开始在 NewRow 上键入时,应将一个实体添加到 _orderEntity.OrderLines。

2/ 当用户取消 NewRow 时,插入的实体应该从 _orderEntity.OrderLines 中移除。

谢谢。

4

1 回答 1

0
        void viewOrderLine_InitNewRow(object sender, InitNewRowEventArgs e)
    {
        var row = (OrderLine)viewOrderLine.GetRow(viewOrderLine.FocusedRowHandle);
        row.Order = _orderEntity;
        _orderEntity.OrderLines.Add(row);
        viewOrderLine.FocusedColumn = viewOrderLine.VisibleColumns[0];
    }
于 2012-07-30T13:32:31.343 回答