DataGrid变色函数类_新(从本质上改属性)
来源:互联网 发布:dbtg数据库 编辑:程序博客网 时间:2024/06/18 17:04
using System;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Xml;
namespace Common
...{
DataGrid变色函数类_新(从本质上改属性)#region DataGrid变色函数类_新(从本质上改属性)
//事件参数类
//自定义DataGridTextBoxColumn_noEdit(cTBC_1),不能编辑.
public class CustomDataGridTextBoxColumn_noEdit : DataGridTextBoxColumn
...{
public event FormatCellEventHandler SetCellFormat;
private int _col;
public CustomDataGridTextBoxColumn_noEdit(int col)
...{
_col = col;
}
protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight)
...{
DataGridFormatCellEventArgs e = new DataGridFormatCellEventArgs(rowNum, this._col, this.DataGridTableStyle.DataGrid.Font, backBrush, foreBrush);
if(SetCellFormat != null)
...{
SetCellFormat(this, e);
}
if(e.UseBaseClassDrawing)
base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
else
...{
g.FillRectangle(e.BackBrush, bounds);
g.DrawString(this.GetColumnValueAtRow(source, rowNum).ToString(), e.TextFont, e.ForeBrush, bounds.X, bounds.Y);
}
if(e.TextFont != this.DataGridTableStyle.DataGrid.Font)
e.TextFont.Dispose();
}
protected override void Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
...{
//取消编辑
//base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
}
}
#endregion
}
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Xml;
namespace Common
...{
DataGrid变色函数类_新(从本质上改属性)#region DataGrid变色函数类_新(从本质上改属性)
//事件参数类
//自定义DataGridTextBoxColumn_noEdit(cTBC_1),不能编辑.
public class CustomDataGridTextBoxColumn_noEdit : DataGridTextBoxColumn
...{
public event FormatCellEventHandler SetCellFormat;
private int _col;
public CustomDataGridTextBoxColumn_noEdit(int col)
...{
_col = col;
}
protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight)
...{
DataGridFormatCellEventArgs e = new DataGridFormatCellEventArgs(rowNum, this._col, this.DataGridTableStyle.DataGrid.Font, backBrush, foreBrush);
if(SetCellFormat != null)
...{
SetCellFormat(this, e);
}
if(e.UseBaseClassDrawing)
base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
else
...{
g.FillRectangle(e.BackBrush, bounds);
g.DrawString(this.GetColumnValueAtRow(source, rowNum).ToString(), e.TextFont, e.ForeBrush, bounds.X, bounds.Y);
}
if(e.TextFont != this.DataGridTableStyle.DataGrid.Font)
e.TextFont.Dispose();
}
protected override void Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
...{
//取消编辑
//base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
}
}
#endregion
}
- DataGrid变色函数类_新(从本质上改属性)
- DataGrid变色函数类_新(从本质上改属性)
- 从本质上解决问题
- prototype本质上还是一个JavaScript对象。 并且每个函数都有一个默认的prototype属性。
- DATAGRID鼠标移动变色
- easyui datagrid隔行变色
- jquery的datagrid的增删改查属性
- i从本质上认识i++与++i
- DataGrid行移动变色,单击变色,双击变色
- php调用类中属性和函数的常用方法->_=>_::_$this->
- DataGrid行随鼠标变色
- DataGrid行随鼠标变色
- WPF-DataGrid设置各行变色
- !!!!重要通知,招新时间从周五改到周六
- DATAGRID属性
- 字节码操作_javassist库_动态创建新类_属性_方法_构造器_API详解JAVA216-217
- 从本质上看网页(asp,jsp)的编写
- 从本质上看网页(asp,jsp)的编写
- DataGrid数据另存为
- gdsg
- JSP/Servlet 入门示例
- javascript横向连续滚动
- DataGrid数据导出到Excel
- DataGrid变色函数类_新(从本质上改属性)
- 新开的博客,大家多多支持啊
- javascript纵向连续滚动
- 通过Visual studio 2005 中的web.sitemap实现OUTLOOK风格的系统菜单
- SqlTest.java 连接数据库后做查询操作
- 获得数据表中指定 列的Cell值与参数值 满足比较关系的第一个行号
- 简易万年历程序源码
- 初始化DataGrid.Column
- 对C51和计算组成及汇编的看法