首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

自定义DataGridView列的设计期支持,自定义属性的保存!

整理日期:2007年08月14日 【字体:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-08/1187080118.html
  }
}

--------------------------------------------------------------------------------

public class MyCustomColumn : DataGridViewColumn
{
  private int _myCustomProperty;
  public int MyCustomProperty
  {
    get { return _myCustomProperty; }
    set { _myCustomProperty = value; }
  }
  .
  .
  .

  }

  经过一番上网搜索,终于找到了解决方法,原来需要在自定义的Column类中,覆盖Clone()方法!经过一番修改,测试,^_^果然搞定。废话少说,示意代码如下:
public override object Clone()
  {
   MyCustomColumn col = (MyCustomColumn)base.Clone();
   col.MyCustomProperty = _myCustomProperty;
   return col;
  }
Tags:
自定义DataGridView列的设计期支持,自定义属性的保存!
'http://www.etoow.com/html/2007-08/1187080118.html
1
 
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved