zoukankan      html  css  js  c++  java
  • GridControl应用

    一 绑定

    1.绑定动态图片

     #region 方法:设置图片列(图片+文字)
            public static void SetColumnToPicture(DevExpress.XtraGrid.Views.Grid.GridView gridView)
            { 
               ImageList imgList = new ImageList();  
              imgList.TransparentColor = Color.Transparent;  
              imgList.ImageSize = new Size(16, 16);  
              imgList.ColorDepth = ColorDepth.Depth32Bit;
    
              Image img0 = Properties.Resources.Retina_Ready_24px_1142019_easyicon_net;       
              Image img1 = Properties.Resources.Hourglass_24px_1102301_easyicon_net;
              Image img2 = Properties.Resources.Success_24px_1194837_easyicon_net;
              imgList.Images.Add("0", img0);  
              imgList.Images.Add("1", img1);  
              imgList.Images.Add("2", img2);          
      
              RepositoryItemImageComboBox riImgCmb = new  RepositoryItemImageComboBox();  
             riImgCmb.Items.AddRange(new ImageComboBoxItem[]
             {  
                   new ImageComboBoxItem("待 上 传",0,0),  
                   new ImageComboBoxItem( "已 上 传" ,1,1),                                                                      
                   new ImageComboBoxItem("已 提 交",2,2),              
             }); 
              riImgCmb.SmallImages = imgList;
              gridView.Columns["UploadStatus"].ColumnEdit = riImgCmb;     
            }
            #endregion

    2.绑定动态:repositoryItemPopupContainerEdit

    二.编辑表格

      编辑表格其实是对数据源的操作,所以如需编辑必定要有数据源,哪怕是空表。

      #region 方法:创建空表(待上传Dt)
            public static DataTable CreateDtForWaitUpload()
            {
                DataTable dt = new DataTable();
                dt.Columns.AddRange(
                 new DataColumn[]
                 {                   
                       new DataColumn("ID",typeof(string)),
                        new DataColumn("FilePath",typeof(string)),
                        new DataColumn("FileName",typeof(string)),
                        new DataColumn("UploadTypeName",typeof(string)),
                        new DataColumn("FileSize",typeof(string)), 
                        new DataColumn("FileContent",typeof(byte[])),
                         new DataColumn("UploadStatus",typeof(int)), 
                         new DataColumn("UploadStatusImage",typeof(Byte[])),
                          
                    }
                       );
                return dt;
            }
            #endregion
  • 相关阅读:
    使用selenium模拟登陆12306以及滑块验证
    网络爬虫之requests模块
    网络爬虫简介
    MongoDB基础操作
    redis集群搭建以及常见问题
    redis的主从复制
    Linux下如何安装mysql
    python 序列化模块
    python os模块和sys模块
    python 时间模块
  • 原文地址:https://www.cnblogs.com/mamaxiaoling/p/8257000.html
Copyright © 2011-2022 走看看