cxVerticalGrid

cxVerticalGrid can't get values

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  lvName, lvValue: string;
begin
  for i := 0 to cxVerticalGrid1.Rows.Count - 1 do
  begin
    if cxVerticalGrid1.Rows.Items[i] is TcxEditorRow then
    begin
      lvName := cxVerticalGrid1.Rows.Items[i].Name;
      if cxVerticalGrid1.Rows.Items[i].Focused then
        lvValue := VarToStr(cxVerticalGrid1.InplaceEditor.EditValue)
      else
        lvValue := VarToStr(TcxEditorRow(cxVerticalGrid1.Rows.Items[i]).Properties.Value);
      Memo1.Lines.Add(lvName + ':' + lvValue);
    end;
  end;
end;

How to work with an in-place CheckComboBox in VerticalGrid

function TForm1.GetComboChecks(cxCheckComboBoxProperties: TcxCheckComboBoxProperties; vValues: Variant; sDelim: string = ','): string;
Var
  i: Integer;
  ACheckStates: TcxCheckStates;
begin
  with cxCheckComboBoxProperties do
    begin
      items.BeginUpdate;
      try

        CalculateCheckStates(vValues, items, EditValueFormat, ACheckStates);

        for I := 0 to items.Count - 1 do
          if ACheckStates[i] = cbsChecked then
            result := items[i].Description + sDelim + result;

        if result <> '' then //получаем 101,12,1024,
            Delete(result, Length(result), 1);//удаляем последнюю запятую

      finally
        items.EndUpdate;
      end;//try
    end;//with
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
  v: variant;
begin
  ShowMessage(GetComboChecks(cxVerticalGrid1EditorRow1.Properties.EditProperties as TcxCheckComboBoxProperties, v));
  ShowMessage(VarToStr(v));
end;

Copy text from VerticalGrid row to TcxRichEdit

<cxRichEdit>.EditValue :=
    <cxVerticalGrid>.DataController.Values[<RecordIndex>, <ItemIndex>];

TcxVerticalGrid - Retrieve Values at Runtime

var
  I: Integer;
  V: Variant;
...
  with cxVerticalGrid1.Rows do
    for I := 0 to Count - 1 do
      if Items[0] is TcxEditorRow then
        V := TcxEditorRow(Items[0]).Properties.Value;

cxVerticalGrid Actual value

procedure TForm1.TestEditPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
  with TForm2.Create(Self) do
  try
    if ShowModal = mrOK then
    begin
      (Sender as TcxButtonEdit).EditValue := ID;
      (Sender as TcxButtonEdit).PostEditValue;
    end;
  ...
原文地址:https://www.cnblogs.com/railgunman/p/9471055.html