-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDefault.aspx.cs
36 lines (31 loc) · 985 Bytes
/
Default.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web;
namespace GridRuntime {
public partial class _Default : System.Web.UI.Page {
protected void Page_Init(object sender, EventArgs e) {
ASPxGridView grid = new ASPxGridView();
grid.ID = "grid";
grid.KeyFieldName = "ID";
grid.DataSource = GetData();
this.form1.Controls.Add(grid);
grid.DataBind();
}
public DataTable GetData() {
DataTable Table = new DataTable();
Table.Columns.Add("ID", typeof(int));
Table.Columns.Add("ItemName", typeof(string));
Table.Rows.Add(1, "A");
Table.Rows.Add(2, "B");
return Table;
}
}
}