zoukankan      html  css  js  c++  java
  • 控制cxGrid 主从表的明细只展开一个

    procedure TForm.ADetailDataControllerCollapsing(
      ADataController: TcxCustomDataController; ARecordIndex: Integer;
      var AAllow: Boolean);
    var
      I: Integer;
      C: Integer;
    begin
      AAllow := False;
      C := 0;
      for I := 0 to ADataController.RecordCount - 1 do
      begin
        if ADataController.GetDetailExpanding(I) then
          Inc(C);
        if C > 1 then
          AAllow := True;
      end;
    end;
    
    
    procedure TForm.ADetailDataControllerExpanding(
      ADataController: TcxCustomDataController; ARecordIndex: Integer;
      var AAllow: Boolean);
    begin
      ADataController.CollapseDetails;
    end;
    
    procedure TForm.FormCreate(Sender: TObject);
    begin
      inherited;
      //控制只展开一个明细
      cxGridVMain.DataController.OnDetailExpanding := ADetailDataControllerExpanding;
      cxGridVMain.DataController.OnDetailCollapsing := ADetailDataControllerCollapsing;
    
    end;
    
    
  • 相关阅读:
    mysql_单表查询
    mysql_建表
    MySQL基础
    JS_左边栏菜单
    Vue框架之组件系统
    Vue常用语法及命令
    Django的缓存,序列化,ORM操作的性能
    Django中的form表单
    Django中的auth模块
    AJAX请求提交数据
  • 原文地址:https://www.cnblogs.com/yooplmqj/p/4097046.html
Copyright © 2011-2022 走看看