zoukankan      html  css  js  c++  java
  • How to force the grid to have one master row always expanded

    If you want your grid to have only a single detail View always expanded, there can be two different solutions to this problem:

    1)  If you don't need automatic sorting, grouping, summary calculation in the grid, this feature can be easily implemented if you use both GridViews in standard GridMode.  Please note, in this case all the features we mentioned will be disabled.  Please review the "Grid Mode: Master-Detail" topic from our documentation to learn how to adjust the grid and its DataSets properly.

    2)  Another solution which will allow you to implement this feature is to handle the DataController's OnDetailExpanding and OnDetailCollapsing events.  Please note that these events are declared as public, so you need to define their handlers in code:

    [Delphi]

    procedure TForm1.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 TForm1.ADetailDataControllerExpanding(
      ADataController: TcxCustomDataController; ARecordIndex: Integer;
      var AAllow: Boolean);
    begin
      ADataController.CollapseDetails;
    end;
     
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      cxGrid1DBTableView1.DataController.OnDetailExpanding := ADetailDataControllerExpanding;
      cxGrid1DBTableView1.DataController.OnDetailCollapsing := ADetailDataControllerCollapsing;
    end;
     

    http://www.devexpress.com/Support/Center/p/A895.aspx
  • 相关阅读:
    依靠MySQL(frm、MYD、MYI)数据文件恢复
    Centos7.4.1708安装Jumpserver
    Ubuntu16.04安装vmware pro 15激活码
    AIX系统命令
    virtualbox迁移虚拟机
    RedHat Enterprise7 搭建ISCSI
    RedHat Enterprise7 修改为CentOS的yum源
    关于Server2008 R2日志的查看
    Centos7.4.1708搭建syslog服务
    ElasticSearch第四步-查询详解
  • 原文地址:https://www.cnblogs.com/railgunman/p/1936705.html
Copyright © 2011-2022 走看看