[ASPX]
<ej:TreeGrid runat="server" ID="TreeGridControlSQLBinding" IdMapping="TaskId"
<Columns>
<ej:TreeGridColumn HeaderText="Task Id" Field="TaskId" Width="45" />
<ej:TreeGridColumn HeaderText="Task Name" Field="TaskName" />
<ej:TreeGridColumn HeaderText="Start Date" Field="StartDate" />
<ej:TreeGridColumn HeaderText="End Date" Field="EndDate" />
<ej:TreeGridColumn HeaderText="Duration" Field="Duration" />
<ej:TreeGridColumn HeaderText="Progress" Field="Progress" />
</Columns>
<SizeSettings Width="100%" Height="450px" /> |
[CS]
protected void Page_Load(object sender, EventArgs e)
{
var DataSource = this.GetDataSource();
this.TreeGrid.DataSource = DataSource;
List<TreeGridColumn> colList = new List<TreeGridColumn>();
colList.Add(new TreeGridColumn() { Field = "TaskId", HeaderText = "ID", Width = 45 });
colList.Add(new TreeGridColumn() { Field = "TaskName", HeaderText = "Task Name" });
colList.Add(new TreeGridColumn() { Field = "StartDate", HeaderText = "Start Date" });
this.TreeGrid.Columns.AddRange(colList);
this.TreeGrid.DataBind(); |