zoukankan      html  css  js  c++  java
  • DevExpress控件GridView使用方法记录

    gridView水平滚动条:

    this.gridView1.OptionsView.ColumnAutoWidth = false;//自动列宽无效,同时出现水平滚动条
    

    gridView显示行号,gridView的CustomDrawRowIndicator事件中处理,把IndicatorWidth设置一个宽度,也可在Load事件中加入this.gridView1.IndicatorWidth = 65;

    //也可在Load事件中加入this.gridView1.IndicatorWidth = 65;
    private
    void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; if (e.Info.IsRowIndicator) { if (e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } else if (e.RowHandle < 0 && e.RowHandle > -1000) { e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite; e.Info.DisplayText = "G" + e.RowHandle.ToString(); } } }

    GridControl.DataSouce = dt;绑定数据表后在GridView表中不显示数据

    string sql = string.Format("select * from tb_Details where ID='{0}'",ID);
    
                dt = SqlHelper.ExecuteReader(SqlHelper.ConnStr, CommandType.Text, sql);
                this.gridControl1.DataSource = dt.DefaultView;
                this.gridControl1.RefreshDataSource();//加上这句就显示出来了

    持续更新记录中....

  • 相关阅读:
    Mysql体系结构(第4天)
    常用的课程网站
    Mysql 升级、用户与授权,
    Bootstrap
    项目中用到的一些特殊字符和图标 Content:"2715",特殊字符和图标
    CentOS 7 安装与卸载MySQL
    Iterm2使用
    Linux定时任务
    Ext.create细节分析
    Ext.define细节分析
  • 原文地址:https://www.cnblogs.com/coreybrans/p/3579629.html
Copyright © 2011-2022 走看看