zoukankan      html  css  js  c++  java
  • UltraGrid常用方法属性代码

    一、UltraGrid更换行背景色

    private void dxGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
            {
                foreach (UltraGridRow row in this.dxGrid.Rows)
                {
                    if (row.Cells["IsAllowEdit"].Value.ToString() == "True")
                    {
                        row.Appearance.BackColor = Color.LightBlue;
                    }
                    if (row.Cells["ConfirmPayApproveID"].Value.ToString() == "3")
                    {
                        row.Appearance.BackColor = Color.LightGreen;
                    }               
                }
            }

    二、UltraGrid多表头代码设置

                    DateTime currentDateTime=base.GetServerTime();        //当前时间
                    DateTime currentStartMonth = currentDateTime.AddDays(1 - currentDateTime.Day);   //本月月初
                    DateTime lastStartMonth1 = currentStartMonth.AddMonths(-3);       //前三月月初
                    DateTime lastStartMonth2 = currentStartMonth.AddMonths(-2);       //前二月月初
                    DateTime lastStartMonth3 = currentStartMonth.AddMonths(-1);       //前一月月初
                    this.dxGrid.DisplayLayout.Bands[0].Columns["自驾"].RowLayoutColumnInfo.LabelPosition = LabelPosition.LabelOnly;
                    this.dxGrid.DisplayLayout.Bands[0].Columns["代驾"].RowLayoutColumnInfo.LabelPosition = LabelPosition.LabelOnly;

                    this.dxGrid.DisplayLayout.Bands[0].Columns["SelfDriveFisrtMonthAMount"].Header.Caption =lastStartMonth1.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["SelfDriveSecondMonthAMount"].Header.Caption = lastStartMonth2.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["SelfDriveThirdMonthAMount"].Header.Caption = lastStartMonth3.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["SelfDriveAllMonthAMount"].Header.Caption = "合计";

                    this.dxGrid.DisplayLayout.Bands[0].Columns["ChauffeurDirveFisrtMonthAMount"].Header.Caption = lastStartMonth1.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["ChauffeurDirveSecondMonthAMount"].Header.Caption = lastStartMonth2.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["ChauffeurDirveThirdMonthAMount"].Header.Caption = lastStartMonth3.ToString("yyyy年MM月");
                    this.dxGrid.DisplayLayout.Bands[0].Columns["ChauffeurDirveAllMonthAMount"].Header.Caption = "合计";

                    for (int i = 0; i < this.dxGrid.DisplayLayout.Bands[0].Columns.Count; i++)
                    {
                        this.dxGrid.DisplayLayout.Bands[0].Columns[i].Header.Appearance.TextVAlign = Infragistics.Win.VAlign.Middle;
                        this.dxGrid.DisplayLayout.Bands[0].Columns[i].Header.Appearance.TextHAlign = Infragistics.Win.HAlign.Center;
                    }

  • 相关阅读:
    053-98
    053-672
    053-675
    1031 Hello World for U (20分)
    1065 A+B and C (64bit) (20分)
    1012 The Best Rank (25分)
    1015 Reversible Primes (20分)
    1013 Battle Over Cities (25分)
    1011 World Cup Betting (20分)
    1004 Counting Leaves (30分)
  • 原文地址:https://www.cnblogs.com/xqf222/p/3306811.html
Copyright © 2011-2022 走看看