首页 > 开发 > 综合 > 正文

有数据绑定、排序、查找功能的ListView(二):

2024-07-21 02:23:17
字体:
来源:转载
供稿:网友
using system;
using system.data;
using system.text;
using system.globalization;
using system.collections;
using system.reflection;

using system.drawing;
using system.drawing.drawing2d;
using system.drawing.design;

using system.windows.forms;
using system.windows.forms.design;

using system.componentmodel;
using system.componentmodel.design;
using system.componentmodel.design.serialization;

using system.runtime.interopservices;

namespace commonframe.ocx
{
/// <summary>
/// 为listview增加数据绑定、查找和排序功能
/// </summary>
///

#region 枚举
public enum sorttype
{
string,
number,
date
}
#endregion

#region 继承实现listview列表类
public class listviewex : system.windows.forms.listview
{

#region 列表项目所需的windows32 api定义

[structlayout(layoutkind.sequential)]
private struct hditem
{
public int32 mask;
public int32 cxy;
[marshalas(unmanagedtype.lptstr)]
public string psztext;
public intptr hbm;
public int32 cchtextmax;
public int32 fmt;
public int32 lparam;
public int32 iimage;
public int32 iorder;
};

[structlayout(layoutkind.sequential) ]
public struct lvfindinfo
{
public lvfi_flags flags;
public string psz;
public intptr lparam;
public point pt;
public virtualkey vkdirection ;
}

public enum lvfi_flags
{
lvfi_param = 0x1,
lvfi_partial = 0x8,
lvfi_string = 0x2,
lvfi_wrap = 0x20,
lvfi_nearestxy = 0x40,
}

public enum virtualkey
{
vk_left = 0x25,
vk_right = 0x27,
vk_up = 0x26,
vk_down = 0x28,
vk_home = 0x24,
vk_end = 0x23,
vk_prior = 0x21,
vk_next = 0x22
}

[dllimport("user32")]
static extern intptr sendmessage(intptr handle, int32 msg, intptr wparam, intptr lparam);
[dllimport("user32", entrypoint="sendmessage")]
static extern intptr sendmessageh(intptr handle, int32 msg, intptr wparam, ref hditem lparam);
[dllimport("user32.dll", entrypoint="sendmessage", charset=charset.auto)]
static extern int sendmessagel(system.intptr hwnd, int32 msg, int wparam, ref lvfindinfo lparam);

const int32 hdi_width = 0x0001;
const int32 hdi_height = hdi_width;
const int32 hdi_text = 0x0002;
const int32 hdi_format = 0x0004;
const int32 hdi_lparam = 0x0008;
const int32 hdi_bitmap = 0x0010;
const int32 hdi_image = 0x0020;
const int32 hdi_di_setitem = 0x0040;
const int32 hdi_order = 0x0080;
const int32 hdi_filter = 0x0100; // 0x0500

const int32 hdf_left = 0x0000;
const int32 hdf_right = 0x0001;
const int32 hdf_center = 0x0002;
const int32 hdf_justifymask = 0x0003;
const int32 hdf_rtlreading = 0x0004;
const int32 hdf_ownerdraw = 0x8000;
const int32 hdf_string = 0x4000;
const int32 hdf_bitmap = 0x2000;
const int32 hdf_bitmap_on_right = 0x1000;
const int32 hdf_image = 0x0800;
const int32 hdf_sortup = 0x0400; // 0x0501
const int32 hdf_sortdown = 0x0200; // 0x0501

const int32 lvm_first = 0x1000; // list 消息
const int32 lvm_finditema = lvm_first + 13;
const int32 lvm_finditemw = lvm_first + 83;
const int32 lvm_getheader = lvm_first + 31;

const int32 hdm_first = 0x1200; // header 消息
const int32 hdm_setimagelist = hdm_first + 8;
const int32 hdm_getimagelist = hdm_first + 9;
const int32 hdm_getitem = hdm_first + 11;
const int32 hdm_setitem = hdm_first + 12;

#endregion

private string m_strdatafilter = "";
private int m_intsortcolumn = -1;
private string m_strdatamember = "";
private currencymanager m_objdatamanager = null;
private dataset m_objdata = null;
private dataview m_objview = null;

internal bool m_blnmodifieditem = true;

private commonframe.ocx.listviewitemscollection m_objitems ;
private commonframe.ocx.columnheadermappingcollection m_objmappings ;

public listviewex()
{
m_objitems = new commonframe.ocx.listviewitemscollection(this);
m_objmappings = new commonframe.ocx.columnheadermappingcollection();
}

#region 属性

[
categoryattribute("data"),
browsableattribute(true),
descriptionattribute("设置的数据成员"),
designerserializationvisibilityattribute(designerserializationvisibility.visible),
defaultvalueattribute("")
]
public string datamember
{
get
{
return m_strdatamember;
}
set
{
m_strdatamember = value;
//this.setdatamember();
}
}

[
categoryattribute("data"),
browsableattribute(true),
descriptionattribute("设置数据源"),
designerserializationvisibilityattribute(designerserializationvisibility.visible),
defaultvalueattribute(null)
]
public dataset datasource
{
get
{
return m_objdata;
}
set
{
m_objdata = value;
this.setdatasource();
}
}

[
browsableattribute(false),
designerserializationvisibilityattribute(designerserializationvisibility.hidden)
]
public string datafilter
{
get
{
return m_strdatafilter;
}
set
{
if (this.m_objdata != null)
{
m_strdatafilter = value;
this.setdatafilter();
}
else
{
m_strdatafilter = "";
}
}
}

[
categoryattribute("杂项"),
browsableattribute(true),
descriptionattribute("列表项集合"),
designerserializationvisibilityattribute(designerserializationvisibility.content),
defaultvalueattribute(null)
]
public commonframe.ocx.listviewitemscollection items
{
get
{
return m_objitems;
}
}

[
categoryattribute("杂项"),
browsableattribute(true),
descriptionattribute("列表标头与数据成员映射集合"),
designerserializationvisibilityattribute(designerserializationvisibility.content),
defaultvalueattribute(null)
]
public commonframe.ocx.columnheadermappingcollection columnheadermappings
{
get
{
return m_objmappings;
}
set
{
m_objmappings = value;
}
}

public bool multiselect
{
get
{
return base.multiselect;
}
set
{
base.multiselect = value;
if ((this.datasource != null) && (base.multiselect == true))
{
base.multiselect = false;
throw new exception("已经设置了数据源datasource,不能多选");
}
}
}

#endregion

#region 方法

// 填充数据
private void filllistviewitems()
{
listviewitem item = null;
int introwcount = this.m_objdatamanager.count ;

this.beginupdate();

//允许修改列表项目
this.m_blnmodifieditem = true;
//清除已经有的列表项目
if(this.items.count>0)
{
this.items.clear();
}

for(int i=0;i<introwcount;i++)
{
item = new listviewitem(m_objview[i][this.m_objmappings[0].mappingfield].tostring());
for(int j=1;j<this.m_objmappings.count;j++)
{
item.subitems.add(m_objview[i][this.m_objmappings[j].mappingfield].tostring());
}
this.items.add(item);
}

this.endupdate();
this.m_blnmodifieditem = false;
}

private void setdatasource()
{
if (m_objdata != null)
{
this.m_blnmodifieditem = true;
//清空列表项目
this.items.clear();
//设置多选属性为单选
this.multiselect = false;
this.m_blnmodifieditem = false;
}
}

private void setdatamember()
{
if ((m_objdata == null) || (m_strdatamember == null) ||(m_strdatamember == ""))
{
this.columns.clear();
this.columnheadermappings.clear();
return;
}

datacolumncollection objdc = m_objdata.tables[m_strdatamember].columns;

if (objdc != null)
{
this.m_blnmodifieditem = true;
this.columns.clear();

for( int i=0;i<objdc.count;i++)
{
columnheader ch = this.columns.add(objdc[i].columnname.trim(),60,horizontalalignment.left);
this.m_objmappings.add(ch,objdc[i].columnname.trim());
}

this.m_blnmodifieditem = false;
}
}

private void setdatafilter()
{
if ( this.datafilter != m_objview.rowfilter)
{
m_objview.rowfilter = this.datafilter;
}
}

//查找项目
public listviewitem finditem(listview listview,string itemtext,bool includesubitemsinsearch)
{
if (listview.items.count == 0)
{
return null;
}

if (includesubitemsinsearch == false)
{
for(int i=0;i<listview.items.count;i++)
{
if (listview.items[i].text == itemtext)
{
listview.items[i].selected = true;
listview.items[i].ensurevisible();
return listview.items[i];
}
}
}
else
{
int intitemindex = 0;
int intsubitemindex = 0;

while (intitemindex < listview.items.count)
{
intsubitemindex = 0;
listviewitem objitem = listview.items[intitemindex];

while (intsubitemindex < objitem.subitems.count)
{
if (itemtext == objitem.subitems[intsubitemindex].text)
{
objitem.selected = true;
objitem.ensurevisible();
return objitem;
}

intsubitemindex += 1;
}

intitemindex += 1;
}
}
return null;
}


#endregion

#region 事件

//在选择列表项后,同步其他数据绑定的控件
protected override void onselectedindexchanged(eventargs e)
{
base.onselectedindexchanged (e);

if ((this.focuseditem != null) && (m_objdatamanager != null))
{
m_objdatamanager.position = (int)this.focuseditem.index ;
}
}
//获取currencymanager,以实现同其他数据绑定控件的同步
protected override void onbindingcontextchanged(eventargs e)
{
base.onbindingcontextchanged (e);

if ((this.parent!= null) && (this.parent.bindingcontext != null) &&
(m_objdata != null) && (m_strdatamember != null) && (m_objdatamanager == null))
{
m_objdatamanager = (currencymanager)this.parent.bindingcontext[m_objdata,m_strdatamember];

if (m_objdatamanager != null)
{
this.m_objview = (dataview)m_objdatamanager.list;
m_objdatamanager.positionchanged += new eventhandler(datasource_positionchanged);
m_objdatamanager.itemchanged += new itemchangedeventhandler(datasource_itemchanged);
}
}
}

//排序
protected override void oncolumnclick(columnclickeventargs e)
{
base.oncolumnclick (e);

if(e.column == m_intsortcolumn)
{
if (this.sorting == sortorder.ascending)
{
this.sorting = sortorder.descending;
}
else
{
this.sorting = sortorder.ascending;
}
}
else
{
m_intsortcolumn = e.column;
this.sorting = sortorder.ascending;
}

//对于没有进行数据绑定时,使用listview本身的排序功能
if (m_objdatamanager == null)
{
this.listviewitemsorter = new listviewitemcomparer(m_intsortcolumn,this.sorting,this.m_objmappings[m_intsortcolumn].sorttype);
this.sort();
}
//对于进行数据绑定时的排序,使用dataview的排序功能
else
{
string strorder = "";

if ( this.sorting == sortorder.ascending)
{
strorder = "asc";
}
else if (this.sorting == sortorder.descending)
{
strorder = "desc";
}
m_objview.sort = this.m_objmappings[m_intsortcolumn].mappingfield + " " + strorder;
}
}
//当其他的数据绑定控件修改当前选项时,listview同步
private void datasource_positionchanged(object sender,eventargs e)
{
if (this.items.count > 0 )
{
this.items[m_objdatamanager.position].selected = true;
this.items[m_objdatamanager.position].ensurevisible();
}
}

//当数据源dataset有内容时,自动填充listview
private void datasource_itemchanged(object sender ,itemchangedeventargs e)
{
if (this.designmode == false)
{
filllistviewitems();

}
}
#endregion
}

#endregion
#region 排序管理类

public class listviewitemcomparer : system.collections.icomparer
{
private int m_intcolumn = 0;
private sorttype m_enmsorttype = sorttype.string;
private sortorder m_enmsortorder = sortorder.ascending ;

public listviewitemcomparer (int columnindex,sortorder sortorder)
{
m_intcolumn = columnindex;
m_enmsortorder = sortorder;
}

public listviewitemcomparer (int columnindex,sortorder sortorder,sorttype sorttype)
{
m_intcolumn = columnindex;
m_enmsorttype = sorttype;
m_enmsortorder = sortorder;
}

int icomparer.compare(object x, object y)
{
int intsort = 0;

if(m_enmsorttype == sorttype.string) //字符排序
{
intsort = string.compare(((listviewitem)x).subitems[m_intcolumn].text.trim(),
((listviewitem)y).subitems[m_intcolumn].text.trim()
);
}
else if (m_enmsorttype == sorttype.number) //数值排序
{
try
{
system.double firstnumber =
double.parse(((listviewitem)x).subitems[m_intcolumn].text);
system.double secondnumber =
double.parse(((listviewitem)y).subitems[m_intcolumn].text);
if (firstnumber > secondnumber)
{
intsort = 1;
}
else if (firstnumber < secondnumber)
{
intsort = -1;
}
else
{
intsort = 0;
}
}
catch
{
intsort = string.compare(((listviewitem)x).subitems[m_intcolumn].text,
((listviewitem)y).subitems[m_intcolumn].text);
}
}
else if (m_enmsorttype == sorttype.date) //日期排序
{
try
{
system.datetime firstdate =
datetime.parse(((listviewitem)x).subitems[m_intcolumn].text);
system.datetime seconddate =
datetime.parse(((listviewitem)y).subitems[m_intcolumn].text);
intsort = datetime.compare(firstdate, seconddate);
}
catch
{
intsort = string.compare(((listviewitem)x).subitems[m_intcolumn].text,
((listviewitem)y).subitems[m_intcolumn].text);
}
}

if(m_enmsortorder == sortorder.descending)
{
return intsort*= -1;
}
else
{
return intsort;
}
}
}

#endregion

#region 继承列表项目集合类。当设定datasource属性时,不允许增加、插入、删除列表项目

public class listviewitemscollection : listview.listviewitemcollection
{
private commonframe.ocx.listviewex m_lvwbase = null;

public listviewitemscollection(commonframe.ocx.listviewex listview):base(listview)
{
m_lvwbase = listview;
}

public int count
{
get
{
return base.count;
}
}

public listviewitem this[int index]
{
get
{
return base[index];
}
}

public int indexof(listviewitem item)
{
return base.indexof(item);
}

public void remove(system.windows.forms.listviewitem item)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许删除项目");
}
else
{
base.remove(item);
}
}

public void removeat(int index)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许删除项目");
}
else
{
base.removeat(index);
}
}

public system.windows.forms.listviewitem add(string text)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
return base.add(text);
}
}

public system.windows.forms.listviewitem add(string text,int imageindex)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
return base.add(text,imageindex);
}
}

public void insert(int index,system.windows.forms.listviewitem item)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
base.insert(index,item);
}
}

public void insert(int index,string text)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
base.insert(index,text);
}
}

public void insert(int index,string text,int imageindex)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
base.insert(index,text,imageindex);
}
}

public void addrange(system.windows.forms.listviewitem[] values)
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许添加项目");
}
else
{
base.addrange(values);
}
}

public void clear()
{
if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
{
throw new exception("已经设置了datasource,不允许清空项目");
}
else
{
base.clear();
}
}
}

#endregion

#region 列标头映射集合类,实现ilist接口,对columnheadermapping类进行管理

public class columnheadermappingcollection : system.collections.ilist
{
private arraylist m_arrcolumnheardermapping = new arraylist(15);

public columnheadermappingcollection()
{
}

#region 实现ilist接口

int ilist.add(object value)
{
return m_arrcolumnheardermapping.add(value);
}

void ilist.clear()
{
m_arrcolumnheardermapping.clear();
}

bool ilist.contains(object item)
{
return m_arrcolumnheardermapping.contains(item);
}

int ilist.indexof(object value)
{
return m_arrcolumnheardermapping.indexof(value);
}

void ilist.insert(int index,object value)
{
m_arrcolumnheardermapping.insert(index,value);
}

bool ilist.isfixedsize
{
get
{
return m_arrcolumnheardermapping.isfixedsize;
}
}

bool ilist.isreadonly
{
get
{
return m_arrcolumnheardermapping.isreadonly;
}
}

void ilist.remove(object obj)
{
m_arrcolumnheardermapping.remove(obj);
}

void ilist.removeat(int index)
{
m_arrcolumnheardermapping.removeat(index);
}

object ilist.this[int index]
{
get
{
return m_arrcolumnheardermapping[index];
}
set
{
}
}

bool system.collections.icollection.issynchronized
{
get
{
return m_arrcolumnheardermapping.issynchronized;
}
}

object system.collections.icollection.syncroot
{
get
{
return m_arrcolumnheardermapping.syncroot;
}
}

void system.collections.icollection.copyto(system.array array,int arrayindex)
{
m_arrcolumnheardermapping.copyto(array,arrayindex);
}

#endregion

public int count
{
get
{
return m_arrcolumnheardermapping.count;
}
}

public columnheadermapping this[int index]
{
get
{
return (columnheadermapping)m_arrcolumnheardermapping[index];
}
}

public void add(columnheader columnheader,string mappingfield)
{
m_arrcolumnheardermapping.add(new columnheadermapping(columnheader,mappingfield));
}

public void add(columnheadermapping columnheadermapping)
{
m_arrcolumnheardermapping.add(columnheadermapping);
}

public void addrange(columnheadermapping[] columnheadmappings)
{
m_arrcolumnheardermapping.addrange(columnheadmappings);
}

public void addrange(columnheader[] columnheaders,string[] mappingfields)
{
if (columnheaders.length != mappingfields.length)
{
return;
}
for(int i=0;i<mappingfields.length;i++)
{
m_arrcolumnheardermapping.add(new columnheadermapping(columnheaders[i],mappingfields[i]));
}
}

public void remove(columnheadermapping columnheadermapping)
{
m_arrcolumnheardermapping.remove(columnheadermapping);
}

public void clear()
{
m_arrcolumnheardermapping.clear();
}

public int indexof(columnheadermapping columnheadermapping)
{
return m_arrcolumnheardermapping.indexof(columnheadermapping);
}

public void insert(int index,columnheadermapping columnheadermapping)
{
m_arrcolumnheardermapping.insert(index,columnheadermapping);
}

public void insertrange(int index,columnheadermapping[] columnheadermappings)
{
m_arrcolumnheardermapping.insertrange(index,columnheadermappings);
}

public bool contains(columnheadermapping columnheader)
{
return m_arrcolumnheardermapping.contains(columnheader);
}

public system.collections.ienumerator getenumerator()
{
return m_arrcolumnheardermapping.getenumerator();
}
}
#endregion

#region 列表标头映射类,实现列表标头同数据库表字段的映射,定义列表标头在排序时使用的数据类型

[typeconverterattribute(typeof(columnheadermappingconvert))]
public class columnheadermapping
{
private columnheader m_objcolumnheader;
private string m_strmappingfield;
private sorttype m_enmsorttype;

public columnheadermapping()
{
m_objcolumnheader = new columnheader();
m_strmappingfield = "";
}

public columnheadermapping(columnheader columnheader,string mappingfield)
{
m_objcolumnheader = columnheader;
m_strmappingfield = mappingfield;
}

[
categoryattribute("杂项"),
browsableattribute(true),
descriptionattribute("列表标头"),
designerserializationvisibilityattribute(designerserializationvisibility.content),
defaultvalueattribute(null)
]
public columnheader columnheader
{
get
{
return m_objcolumnheader;
}
set
{
m_objcolumnheader = value;
}
}

[
categoryattribute("杂项"),
browsableattribute(true),
descriptionattribute("映射字段"),
designerserializationvisibilityattribute(designerserializationvisibility.visible),
defaultvalueattribute("")
]
public string mappingfield
{
get
{
return m_strmappingfield;
}
set
{
m_strmappingfield = value;
}
}

[
categoryattribute("杂项"),
browsableattribute(true),
descriptionattribute("列表标头类型"),
designerserializationvisibilityattribute(designerserializationvisibility.visible),
defaultvalueattribute(sorttype.string)
]
public sorttype sorttype
{
get
{
return m_enmsorttype;
}
set
{
m_enmsorttype = value;
}
}
}
#endregion

#region 对columnheadermapping进行转换,实现columnheadermapping类在ide中的序列化

public class columnheadermappingconvert : typeconverter
{
public columnheadermappingconvert()
{
}

public override bool canconvertto(itypedescriptorcontext context, type destinationtype)
{
if (destinationtype == typeof(instancedescriptor))
{
return true;
}

return base.canconvertto(context, destinationtype);
}

public override object convertto(itypedescriptorcontext context, cultureinfo culture, object value, type destinationtype)
{
if (value is columnheadermapping)
{
if (destinationtype == typeof(instancedescriptor))
{
object[] properites = new object[2];
type[] types = new type[2];

columnheadermapping chm = (columnheadermapping)value;

types[0] = typeof(columnheader);
properites[0] = chm.columnheader ;

types[1] = typeof(string);
properites[1] = chm.mappingfield ;

constructorinfo ci = typeof(columnheadermapping).getconstructor(types);
return new instancedescriptor(ci,properites);
}
}
return base.convertto(context, culture, value, destinationtype);
}
}
#endregion

#region 继承列表标头集合类(由于继承列表标头集合类后,新增的列表标头不能显示在列表中,所以已经注释,暂时没有使用)
// public class columnheadercollection : listview.columnheadercollection
// {
// private listview m_lvwbase = null;
//
// public columnheadercollection(commonframe.ocx.listview listview) : base(listview)
// {
// m_lvwbase = listview;
// }
//
// public void remove(columnheader item)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许删除项目");
// }
// else
// {
// base.remove(item);
// }
// }
//
// public void removeat(int index)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许删除项目");
// }
// else
// {
// base.removeat(index);
//
// }
// }
//
// public int add(columnheader value)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许添加项目");
// }
// else
// {
// return base.add(value);
// }
// }
//
// public columnheader add(string text,int width,horizontalalignment textalign)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许添加项目");
// }
// else
// {
// return base.add(text,width,textalign);
// }
// }
//
// public void insert(int index,columnheader item)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许添加项目");
// }
// else
// {
// base.insert(index,item);
// }
// }
//
// public void insert(int index,string text,int width,horizontalalignment textalign)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许添加项目");
// }
// else
// {
// base.insert(index,text,width,textalign);
// }
// }
//
// public void addrange(columnheader[] values)
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许添加项目");
// }
// else
// {
// base.addrange(values);
// }
// }
//
// public void clear()
// {
// if ((m_lvwbase.datasource != null) && (m_lvwbase.m_blnmodifieditem == false))
// {
// throw new exception("已经设置了datasource,不允许清空项目");
// }
// else
// {
// base.clear();
// }
// }
//
// public columnheader this[int index]
// {
// get
// {
// return base[index];
// }
// }
// }
#endregion
}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表