我是一个 janous 网格,我在运行时设置它,我需要将标题和子标题添加到网格。标题包含两部分,一部分是一些字段,另一部分是一些字段。任何人都可以解释如何做到这一点。
我使用 C# windows 窗体应用程序;
Col = new UltraGridColumn();
Col.Caption = "Row";
Col.Width = 10;
Col.HeaderAlignment = Janus.Windows.GridEX.TextAlignment.Center;
Col.Key = "Row";
Col.DataMember = "Row";
MyGrid.Columns.Add(Col);
Col = new UltraGridColumn();
Col.Caption = "Name";
Col.HeaderAlignment = Janus.Windows.GridEX.TextAlignment.Center;
Col.Key = "Name";
Col.DataMember = "Name";
MyGrid.Columns.Add(Col);
Col = new UltraGridColumn();
Col.Caption = "Family";
Col.HeaderAlignment = Janus.Windows.GridEX.TextAlignment.Center;
Col.Key = "Family";
Col.DataMember = "Family";
MyGrid.Columns.Add(Col);
Col = new UltraGridColumn();
Col.Caption = "Address";
Col.Key = "Address";
Col.Width = MyGrid.Width * 18 / 100;
Col.DataMember = "Address";
Col.HeaderAlignment = Janus.Windows.GridEX.TextAlignment.Center;
MyGrid.Columns.Add(Col);
Col = new UltraGridColumn();
Col.Caption = "Tel";
Col.Key = "Tel";
Col.Width = 0;
Col.DataMember = "Tel";
Col.HeaderAlignment = Janus.Windows.GridEX.TextAlignment.Center;
MyGrid.Columns.Add(Col);