隐藏Drag a column header here to group by that column

https://www.devexpress.com/Support/Center/Question/Details/Q412390

I have created a Grid Control to view the Currency table. As there are only ten records in the table, can I hide the "Drag a column header here to group by that column" bar for the Grid Control.

To achieve this goal disable the GridView.OptionsView.ShowGroupPaneloption.

添加或者删除行

https://documentation.devexpress.com/#WindowsForms/CustomDocument752

https://www.devexpress.com/Support/Center/Question/Details/T195251

Please accept my apologies for providing the incorrect information.

The grid can't operate without a data source.

However, you're able to create an empty DataTable (without rows) that has only columns.

Look at the following code:

DataTable dt = new DataTable();
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("Name", typeof(string));
gridControl1.DataSource = dt;

需要注意的是,手动添加了GridColumn的话,需要指定FiledName属性,要和DataTable中的列名保持一致。

设置时间格式,

https://www.devexpress.com/Support/Center/Question/Details/Q360794

To accomplish this task, set the GridColumn.DisplayFormat.FormatType property to the FormatType.DateTime value

禁止编辑

gridView1.OptionsBehavior.Editable = false;

某一列的单元格显示图片

设置GridColumn的ColumnEdit为PictureEdit,设置UnboundType为Object

private DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit repositoryItemPictureEdit1;

设置repositoryItemPictureEdit1的图片显示

某一个单元格的单击事件

https://www.devexpress.com/Support/Center/Question/Details/Q406257

To accomplish this task, use the GridView.RowCellClickevent.

Please note that this event will not fire when clicking on a row cell, if data editing is enabled and the ColumnViewOptionsBehavior.EditorShowMode property is set to MouseDown (and to Default, if multiple row selection is disabled). To accomplish this task, set the GridView.OptionsBehavior.EditorShowMode property to the EditorShowMode.MouseUp value.

 private void gridView1_RowCellClick(object sender, RowCellClickEventArgs e)
{
if (e.Column == gridColumn3)
{
//需要弹出对应行的场景配置详情
Console.WriteLine($@"第{e.RowHandle + 1},第{e.Column.ColumnHandle}列");
}
}

GridControl的更多相关文章

  1. DevExpress学习系列(控件篇):GridControl的基本应用

    一般属性设置 不显示分组框:Gridview->Option View->Show Group Panel=false 单元格不可编辑:gridcontrol -->gridview ...

  2. Devexpress GridControl.Export

    private void mnuExportTable_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { u ...

  3. DevExpress GridControl 选择整行被选单元格不变色的设置

    设置GridControl 里面的 gridview 属性, 找到OptionSelection 将EnableAppearanceFocusedCell 属性设置False 就可以了 此方式同样适用 ...

  4. DevExpress控件的GridControl控件小结

    DevExpress控件的GridControl控件小结 (由于开始使用DevExpress控件了,所以要点滴的记录一下) 1.DevExpress控件组中的GridControl控件不能使横向滚动条 ...

  5. DevExpress GridControl使用方法

    一.如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 二.如何新增一条记录 (1).gridView.AddN ...

  6. DevExpress的GridControl的实时加载数据解决方案(取代分页)

    http://blog.csdn.net/educast/article/details/4769457 evExpress是一套第三方控件 其中有类似DataGridView的控件 今天把针对Dev ...

  7. dev GridControl实现拖拽

    一.示例说明 以gridControl1和gridControl2为例,从gridControl1拖拽行到gridControl2中去. 二.属性设置 gridControl2.AllowDrop = ...

  8. DEV GridControl小结

    1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...

  9. DEVExpress GridControl|TableView |FormatConditions 按一定格式设置相应内容

    Get到一个新技能,感觉好棒.摘自DEV官网:https://www.devexpress.com/Support/Center/Example/Details/T135593 <Window ...

  10. 在gridControl的单元格中的多行文本

    我们知道,gridcontrol里面的单元格默认是不能换行的,但是有时候我们需要显示要换行的文本,应该怎么处理呢?这里提供一个方案: 假设我有一个列”合同文本“(colContractText),我要 ...

随机推荐

  1. //sql过滤关键字

    //sql过滤关键字 public static bool CheckKeyWord(string sWord) { //过滤关键字 string StrKeyWord = @"select ...

  2. 四则运算之C++实现篇

    对四则运算的一些要求如下: 1.题目避免重复:2.可定制(数量/打印方式):3.可以控制下列参数:   是否有乘除法.数值范围.加减有无负数.除法有无余数.否支持分数 (真分数, 假分数, …): 一 ...

  3. Android课程---首学开发

    新建一个Activity2类: package com.hanqi.test; import android.app.Activity; import android.os.Bundle; impor ...

  4. php课程---语句及函数

    语句:    一:分支语句        1.if(条件1){满足条件1执行}    2.if(条件1){满足条件1执行}else{不满足条件1执行}    3.if(条件1){满足条件1执行}els ...

  5. 剑指offer:大恒图像

    大恒图像:成立于1991年,专注于视觉部件.视觉系统及互联网医疗相关产品研发.生产和营销的高科技企业. 旗下产品信息: 1.图像采集卡 摄像机等输入的模拟图像信号经过A/D转换,或将数字摄像机的输出信 ...

  6. Laravel-5.1 ---- 将mews captcha整合到项目中!

    经过摸索,终于能在laravel 5.1中应用验证码了. 因为英语渣五水平,所以几乎没搜索到什么有用的,于是考虑在github上搜索验证码包! 提示: github上的package中往往会有使用说明 ...

  7. 基于swoole的网页一对一实时聊天

    需求分析 网站上实现一对一即时沟通,能查看聊天记录以及离线留言,新消息提醒. 核心技术 html5的websocket,php的swoole扩展http://wiki.swoole.com/ 数据表 ...

  8. 用apktool工具进行apk的编译和反编译

    1.apktool下载安装 给一个2.0版的csdn地址:http://download.csdn.net/download/txj8612/7408775 下载后无需安装,直接解压缩,得到三个文件: ...

  9. RabbitMQ学习总结 第三篇:工作队列Work Queue

    目录 RabbitMQ学习总结 第一篇:理论篇 RabbitMQ学习总结 第二篇:快速入门HelloWorld RabbitMQ学习总结 第三篇:工作队列Work Queue RabbitMQ学习总结 ...

  10. C语言 str2bin 和 bin2str 实现

    需求介绍 在编码或者调试过程中经常需要进行 字节码转换为 十六进制的字符串, 或者将 十六进制字符串 转换为 字节码的需求. 即:  字节码 (内存中存储的 01 串):    11111111 &l ...