随笔分类 - .net
dev GridView常用属性,事件
摘要:一、属性1、GridControl属性 //允许拖拽行 gridControl1.AllowDrop = true;2、GridView属性 //不可编辑 gridView1.OptionsBehavior.Editab...
阅读全文
C# 获取当前路径方法
摘要://获取包含清单的已加载文件的路径或 UNC 位置。
public static string sApplicationPath = Assembly.GetExecutingAssembly ( ).Location;
//result: X:\xxx\xxx\xxx.dll (.dll文件所在的目录+.dll文件名)
//获取当前进程的完整路径,包含文件名(进程名)。
string str = this.GetType ( ).Assembly.Location;
//result: X:\xxx\xxx\xxx.exe (.exe文件所在的目录+.exe文件名)
//获取新的 Process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。
string str = System.Diagnostics.Process.GetCurrentProcess ( ).MainModule
阅读全文
XtraTreeList行定位
摘要:DevExpress.XtraTreeList.TreeList treeList = new DevExpress.XtraTreeList.TreeList();
//绑定数据源
treeList.DataSource = dt;
//记录当前选中节点
TreeListNode node = treeList.FocusedNode;
//重新绑定数据源
treeList.DataSource = dt;
//选中指定行
if (node != null)
{
//根据旧节点找到新节点,有三种方法:
//treeList .FindNodeByID (int nodeID);
//treeList .FindNodeByFieldValue (stri
阅读全文
dhtmlxGrid 添加行号
摘要:添加行号,效果如下:
二、设置属性
设置gridView属性:gridView1 .IndicatorWidth=30;或是在属性窗口中设置值。(可根据实际大小设置IndicatorWidth大小)
三、添加事件
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
{
e.Info.DisplayText =( e.RowHandle+1).ToString();
}
}
四、行号搞定。
当然也可以设置行号列,使用数据源绑定行号值。
阅读全文
浙公网安备 33010602011771号