zoukankan      html  css  js  c++  java
  • 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;
      ...
  • 相关阅读:
    MySQL 分库分表方案
    MySQL高性能优化实战总结
    MySQL太慢?试试这些诊断思路和工具
    Get MySQL这5个优化技巧
    一次MySQL两千万数据大表的优化过程,三种解决方案
    MySQL 常用30种SQL查询语句优化方法
    掌握 MySQL 这 19 个骚操作,效率至少提高3倍
    分分钟解决 MySQL 查询速度慢与性能差
    总结 | 慢 SQL 问题经验总结
    MySQL主从延时这么长,要怎么优化?
  • 原文地址:https://www.cnblogs.com/railgunman/p/9471055.html
Copyright © 2011-2022 走看看