• 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;
      ...
  • 相关阅读:
    linux下文件搜索命令学习笔记
    【转】C++格式化输出
    UNIX中的文件类型
    Unix内核中打开文件的表示
    网络编程学习笔记:linux下的socket编程
    TCP协议学习笔记(一)首部以及TCP的三次握手连接四次挥手断开
    C/C++源代码从写完到运行发生了什么
    C++ 函数形参发生动态绑定时指针增长步长与静态类型一致
    C++中为什么要将析构函数定义成虚函数
    C++求一个十进制的二进制中1的个数
  • 原文地址:https://www.cnblogs.com/railgunman/p/9471055.html
Copyright © 2020-2023  润新知