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();//加上这句就显示出来了

    持续更新记录中....

  • 相关阅读:
    AdminLTE模板
    日历插件
    Jquery 拖拽表格宽度
    Java桌面程序打包成exe可执行文件
    使用Access-Control-Allow-Origin解决跨域
    Ubuntu默认root密码
    Lua的require和module小结
    nginx 安装
    chkconfig命令
    [转]fedora启动telnet服务
  • 原文地址:https://www.cnblogs.com/coreybrans/p/3579629.html
Copyright © 2011-2022 走看看