zoukankan      html  css  js  c++  java
  • devGridView第一列显示行号

    //第一列增加行号
     GridViewl.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler( GridView_CustomDrawRowIndicator); 
       void GridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
            {
                //第一列增加行号
                if (e.Info 

    .IsRowIndicator)
                {
                    //if (this.IsGroupRow(e.RowHandle) == false)
                    if (e.RowHandle >= 0)
                    {
                        e.Info 

    .DisplayText = Convert.ToInt32(e.RowHandle + 1).ToString();
                    }
                }
            }
    //设置宽度
            void GridView_RowCountChanged(object sender, EventArgs e)
            {
                //动态设置第一列的宽度
                string MeasureString = String.Format("{0}WA", rptGridControl1.GridView.RowCount);
                rptGridControl1.GridView.IndicatorWidth = this.rptGridControl1.CreateGraphics().MeasureString(MeasureString, new Font("宋体", 9)).ToSize().Width;
            }
  • 相关阅读:
    mysql的length与char_length的区别
    case when 多个条件 以及case when 权重排序
    ogitor下载地址
    简单单例模式
    求切线和次法线
    Alpha混合物体的深度排序
    C++对齐问题
    Computing Tangent Space Basis Vectors for an Arbitrary Mesh
    .NET三层架构简析
    DaGridView导出Excel
  • 原文地址:https://www.cnblogs.com/liangsheng/p/7866826.html
Copyright © 2011-2022 走看看