zoukankan      html  css  js  c++  java
  • Delphi控件cxGrid 如何动态创建列?

    [delphi] view plaincopy

    1. var i: Integer;    
    2.   Column: TcxGridDBColumn;    
    3.   cxView: TcxGridDBTableView;      
    4. begin    
    5.   cxView := Self.Levels[0].GridView as TcxGridDBTableView;    
    6.   if cxView.DataController.DataSource <> nil then    
    7.     if cxView.DataController.DataSource.DataSet <> nil then    
    8.     begin    
    9.       cxView.ClearItems;    
    10.       for i:=0 to  cxView.DataController.DataSource.DataSet.FieldCount-1 do     
    11.         begin    
    12.          Column := cxView.CreateColumn;    
    13.          Column.DataBinding.FieldName := cxView.DataController.DataSource.DataSet.Fields[i].FieldName;    
    14.          Column.PropertiesClass := TcxTextEditProperties;    
    15.       end;    
    16.     end;    
    17. end;   
  • 相关阅读:
    64_l2
    64_l1
    64_k2
    64_k1
    64_j2
    64_j1
    64_g6
    64_g5
    64_g4
    64_g3
  • 原文地址:https://www.cnblogs.com/martian6125/p/9631099.html
Copyright © 2011-2022 走看看