Custom Set Class /// /// Collection Summary Description. /// summary> public class collection: system.collections.collectionBase {public colic {for (int i = 0; i <10; i ) {base.innerList.Add (New Element (I, String.Format ("A [{0}]", I))))));}}}
The collection element class public class Element {private string name; public string ValueName {get {return name;}} private int valu; public int Value {get {return valu;}} public Element (int val, string nam) {name = nam ; VALU = VAL;}} A summary description of the rear code /// /// WebForm1 of ASPX. /// summary> public class WebForm1: System.Web.UI.Page {protected System.Web.UI.WebControls.DataGrid DataGrid1; private void Page_Load (object sender, System.EventArgs e) {DataGrid1.DataSource = new Collection (); DataGrid1.databind ();
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} /// /// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// summary> private () {this.load = new system.eventhandler (this.page_load);