如上图,gategory 加了小图标, 其他行内还有计算器,大图片   进度条等

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data; namespace DevExpress.XtraEditors.Demos {
/// <summary>
/// Summary description for MultiEditors.
/// </summary>
public partial class MultiEditors : TutorialControl {
public MultiEditors() {
//
// Required for Windows Form Designer support
//
InitializeComponent();
//TutorialInfo.WhatsThisCodeFile = "CS\\GridMainDemo\\Modules\\MultiEditors.cs";
//TutorialInfo.WhatsThisXMLFile = "DevExpress.XtraEditors.Demos.CodeInfo.MultiEditors.xml";
gridControl1.ForceInitialize();
InitData();
//
// TODO: Add any constructor code after InitializeComponent call
//
} #region Init
private Image GetImage(string name) {
System.IO.Stream str = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("DevExpress.XtraEditors.Demos.Images." + name);
if (str != null)
return Bitmap.FromStream(str);
return null;
} private byte[] ImageToByteArray(Image image) {
System.IO.MemoryStream mStream = new System.IO.MemoryStream();
image.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] ret = mStream.ToArray();
mStream.Close();
return ret;
}
private void InitData() {
RecordOrder[] records = new RecordOrder[];
records[] = new RecordOrder(Properties.Resources.ProductName, "Mishi Kobe Niku", "Teatime Chocolate Biscuits", "Ipoh Coffee"); //第一行纯字符串
records[] = new RecordOrder(Properties.Resources.Category, , , ); //第二行带小图标 后边的 6 3 1 是imagelist 控件添加进去 的小图标的顺序号 .从1开始.
records[] = new RecordOrder(Properties.Resources.Supplier, "Tokyo Traders", "Specialty Biscuits, Ltd.", "Leka Trading");
records[] = new RecordOrder(Properties.Resources.QuantityPerUnit, "18 - 500 g pkgs.", "10 boxes x 12 pieces", "16 - 500 g tins");
records[] = new RecordOrder(Properties.Resources.UnitPrice, 97.00, 9.20, 46.00);
records[] = new RecordOrder(Properties.Resources.UnitsInStock, , , );
records[] = new RecordOrder(Properties.Resources.Discontinued, false, true, true);
records[] = new RecordOrder(Properties.Resources.LastOrder, new DateTime(, , ), new DateTime(, , ), new DateTime(, , ));
records[] = new RecordOrder(Properties.Resources.Picture, Properties.Resources.product1, Properties.Resources.product2, Properties.Resources.product3);
records[] = new RecordOrder(Properties.Resources.Relevance, , , ); gridControl1.DataSource = records;
}
#endregion
#region Grid events
//<gridControl1>
   //      Properties.Resources.Category  此处用了属性资源字符串 
gridView1_CustomRowCellEdit   是指定格子里的按钮等控件  比如repositoryItemImageComboBox1 是通过repository 入口进行设置


        private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e) {
if (e.Column.FieldName != "Category") {
RecordOrder rec = gridView1.GetRow(e.RowHandle) as RecordOrder;
if (rec.Category == Properties.Resources.Category) e.RepositoryItem = repositoryItemImageComboBox1;
if (rec.Category == Properties.Resources.Supplier) e.RepositoryItem = repositoryItemComboBox1;
if (rec.Category == Properties.Resources.UnitPrice) e.RepositoryItem = repositoryItemCalcEdit1;
if (rec.Category == Properties.Resources.UnitsInStock) e.RepositoryItem = repositoryItemSpinEdit1;
if (rec.Category == Properties.Resources.Discontinued) e.RepositoryItem = repositoryItemCheckEdit1;
if (rec.Category == Properties.Resources.Discontinued) e.RepositoryItem = repositoryItemCheckEdit1;
if (rec.Category == Properties.Resources.LastOrder) e.RepositoryItem = repositoryItemDateEdit1;
if (rec.Category == Properties.Resources.Picture) e.RepositoryItem = repositoryItemPictureEdit1;
if (rec.Category == Properties.Resources.Relevance) e.RepositoryItem = repositoryItemProgressBar1;
}
}
//</gridControl1> private void gridView1_RowCellDefaultAlignment(object sender, DevExpress.XtraGrid.Views.Base.RowCellAlignmentEventArgs e) {
if (e.Column.FieldName != "Category") {
if (e.RowHandle == || e.RowHandle == )
e.HorzAlignment = DevExpress.Utils.HorzAlignment.Far;
if (e.RowHandle == )
e.HorzAlignment = DevExpress.Utils.HorzAlignment.Center;
}
} //<gridControl1>
/*
~Set custom height for row 8:
*/
private void gridView1_CalcRowHeight(object sender, DevExpress.XtraGrid.Views.Grid.RowHeightEventArgs e) {
if (e.RowHandle == ) e.RowHeight = ;
}
//</gridControl1> #endregion
#region RepositoryItems events
private void repositoryItemProgressBar1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
int i = ;
if (gridView1.ActiveEditor == null) return; if (e.KeyChar == '+') {
i = (int)gridView1.ActiveEditor.EditValue;
if (i < )
gridView1.ActiveEditor.EditValue = i + ;
}
if (e.KeyChar == '-') {
i = (int)gridView1.ActiveEditor.EditValue;
if (i > )
gridView1.ActiveEditor.EditValue = i - ;
}
}
#endregion
}
}
using System;
namespace DevExpress.XtraEditors.Demos {
public class RecordOrder {
private string fcategory;
private object fproduct1;
private object fproduct2;
private object fproduct3; public RecordOrder(string fcategory, object fproduct1, object fproduct2, object fproduct3) {
this.fcategory = fcategory;
this.fproduct1 = fproduct1;
this.fproduct2 = fproduct2;
this.fproduct3 = fproduct3;
} public string Category {
get { return fcategory; }
} public object Product1 {
get { return fproduct1; }
set { fproduct1 = value; }
} public object Product2 {
get { return fproduct2; }
set { fproduct2 = value; }
} public object Product3 {
get { return fproduct3; }
set { fproduct3 = value; }
}
}
}

对于devexpress gridview 内插图加加进度条等的一点解读的更多相关文章

  1. DevExpress GridControl 单元格添加进度条(ProgressBar)

    首先可以使用DevExpress GridControl 自带的进度条控件. 但是我要用一个方法来设置所以的单元格进度,而不是每个单元格都要设置一遍,同时我想要根据进度值不同,进度条显示不同的颜色. ...

  2. jquery 实现拖动文件上传加进度条

    通过对文件的拖动实现文件的上传,主要用到的是HTML5的ondrop事件,上传内容通道FormData传输: //进度条 <div class="parent-dlg" &g ...

  3. easyui datagrid 单元格加进度条(亲测可用)

    {field: 'DataItemNum', title: '数据完整度', width: 100, formatter: function (v, r, i) { var p = (v / 27) ...

  4. layui 文件上传加进度条

    1.页面 <div class="layui-row layui-col-space5"> <div class="layui-form-item&qu ...

  5. 微信小程序-上传多张图片加进度条(支持预览、删除)

    2018-12-24 详情示例见:https://www.cnblogs.com/cisum/p/9564898.html 2018-12-29 组件下载见:https://www.cnblogs.c ...

  6. Js异步上传加进度条

    http://www.ruanyifeng.com/blog/2012/09/xmlhttprequest_level_2.html http://www.cnblogs.com/yuanlong10 ...

  7. 纯H5 AJAX文件上传加进度条功能

    上传代码js部分 //包上传 $('.up_apk').change(function () { var obj = $(this); var form_data = new FormData(); ...

  8. 在DevExpress GridControl中添加进度条控件 z

    首先可以使用 DevExpress GridControl 自带的进度条控件. 但是我要用一个方法来设置所有的单元格进度,而不是每个单元格都要设置一遍,同时我想要根据进度值不同,进度条显示不同的颜色. ...

  9. 关于JFace中的进度条对话框(ProgressMonitorDialog类)

    在Windows操作系统中,最常用的进度条对话框就是文件复制时的弹出框,如果想让用户愉快的使用你开发 的软件,那么在执行某个较长时间的操作时候,就应该弹出一个进度条提示框,告诉用户程序正在做什么. 做 ...

随机推荐

  1. jquery 初始化数据 添加html 第一次玩0.0

    /** * Created by Eee_xiang on 2018/04/12. * 联动响应事件 */ (function () { $.linkEvent = function (options ...

  2. SQL--结构化的查询语言

    SQL--结构化的查询语言T-SQL:Transact-SQL (SQL的增强版) 逻辑运算符 and && or || not ! 关系运算符 等于 = 不等于<>或!= ...

  3. (转)Python新手写出漂亮的爬虫代码2——从json获取信息

    https://blog.csdn.net/weixin_36604953/article/details/78592943 Python新手写出漂亮的爬虫代码2——从json获取信息好久没有写关于爬 ...

  4. Redis Cluster 添加/删除 完整折腾步骤

    Redis还是挺好玩的,今天测试了集群的添加.删除节点.重分配slot等.更深入的理解redis的游戏规则.步骤繁多,但是详细. 环境解释: 我是在一台Centos 6.9上测试的,各个redis节点 ...

  5. 兴趣点 / 关键点( Interest point/Keypoint )

    • 不同视角图片之间的映射           • 稳定局部特征点           • 可重复性.显著性           • 抗图片变换           • 外貌变换(亮度.光照)    ...

  6. Java的学习路线图

    在网上看到一个关于Java的学习路线图,个人感觉很详细.https://blog.csdn.net/s1547823103/article/details/79768938

  7. uuid生成工具类

    public class UUIDTool { public static String getUUID() { return UUID.randomUUID().toString().replace ...

  8. veil-catapult

    veil-catapult进行payload投放,直接使payload在内存中执行. kaliIP:192.168.1.119 目标IP:192.168.1.121 1.powershell powe ...

  9. JSF web.xml的各类参数属性配置

    出处:http://www.cnblogs.com/zxpgo/articles/2570175.html 感谢作者的分享!! ———————————————————————————————————— ...

  10. serv-U使用

    该软件是设置ftp服务器的 可以百度查询ftp服务器安装攻略,如 https://jingyan.baidu.com/article/cb5d6105c00bba005c2fe0ca.html 问题: ...