Beispiel #1
0
 private void DgAttachVouchers_CustomUnboundColumnData(object sender, DevExpress.Xpf.Grid.GridColumnDataEventArgs e)
 {
     if (e.IsGetData)
     {
         int rowId = Convert.ToInt32(e.GetListSourceFieldValue("RowId"));
         e.Value = _attachedVoucherList.Contains(rowId);
         if (_attachedVoucherList.Contains(rowId))
         {
             dgAttachVouchers.View.FocusedRowHandle = e.ListSourceRowIndex;
         }
     }
 }
        private void GridControl_CustomUnboundColumnData(object sender, DevExpress.Xpf.Grid.GridColumnDataEventArgs e)
        {
            if (e.Column.FieldName == "Formulae")
            {
                var            id      = (Guid)e.GetListSourceFieldValue("Id");
                var            context = this.DataContext as  AppParamsViewModel;
                DateTimeOffset date    = (DateTimeOffset)comboDates.SelectedValue;

                if (e.IsGetData)
                {
                    e.Value = context.GetFormulaString(id, date);
                }
                if (e.IsSetData)
                {
                    context.SetFormulaString(id, date, e.Value as string);
                }
            }
        }