728x90
RepositoryItemProgressBar progress = new RepositoryItemProgressBar();
RepositoryItemSpinEdit spin = new RepositoryItemSpinEdit();

void initControl()
{
  DataTable dt = new DataTable();
  dt.Columns.Add("L");
  dt.Rows.Add(1);
  dt.Rows.Add(2);
  dt.Rows.Add(4);
  dt.Rows.Add(10);
  dt.Rows.Add(-1);
  gridControl1.DataSource = dt;
  var colLength = gridView1.Columns.Add();
  colLength.ColumnEdit = progress;
  colLength.FieldName = "L";
  colLength.Visible = true;
  gridControl1.RepositoryItems.AddRange(new RepositoryItem[] { spin, progress});
}

private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
{
  GridView? view = sender as GridView;
  if (e.Column.FieldName == "L" && e.RowHandle == view.FocusedRowHandle)
    e.RepositoryItem = spin;
  }
}
728x90
반응형

+ Recent posts