前段时间,我刚好写了一个扩展DataGrid的控件,在使用中又增加了以下功能:
1、任意字符进行转意
2、自定义合并字段的连接字符
KeyValuePair类 字符键值对实体
1、任意字符进行转意
2、自定义合并字段的连接字符
KeyValuePair类 字符键值对实体
private System.ComponentModel.Container components = null
;
//键值改变事件,用于防值输入相同的键值
public event KeyValuePairKeyChanged KeyChanged;
public void OnKeyChanged()
{
if(KeyChanged!=null )
KeyChanged(_Key);
}
private string _Key;
public string Key
{
get { return _Key; }
set {
_Key = value;
OnKeyChanged();
}
}
private string _Value;
public string Value
{
get { return _Value; }
set { _Value = value; }
}
//键值改变事件,用于防值输入相同的键值
public event KeyValuePairKeyChanged KeyChanged;
public void OnKeyChanged()
{
if(KeyChanged!=null )
KeyChanged(_Key);
}
private string _Key;
public string Key
{
get { return _Key; }
set {
_Key = value;
OnKeyChanged();
}
}
private string _Value;
public string Value
{
get { return _Value; }
set { _Value = value; }
}
KeyValuePairCollection类,继承自CollectionBase,用于保存添加的KeyValuePair对象
KeyValuePairCollectionEditor类,继承自CollectionEditor,用于可视化编辑KeyValuePairCollection集合
效果如下图所示
在使用和转载源码时,请保留版权信息
源码下载v1.1 代码自动生成器v1.1
相关文章
自定义DataGrid控件开源
WinForm DataGrid的功能扩展及实现 (已写完)
希望大家把实际开发中还需要扩展的功能写出来,大家一起把它做得更好,更加快速的提高开发速度