|
|
Rank: Advanced Member
Joined: 6/10/2011 Posts: 37 Points: 111 Location: Belgrade
|
I have datatable populated with items Code: DataTable komTable = new DataTable(); komTable.Columns.Add("Komentar", typeof(string)); komTable.Columns.Add("Kreirao", typeof(string)); komTable.Columns.Add("Datum kreiranja", typeof(string));
foreach (var item in dsAnalystCommentLog) { komTable.Rows.Add(item.Comment,item.EnteredBy,item.EnteredDate); } Now I want to populate EntreeListItemDataGrid with them. Any example, Alex
|
|
 Rank: ME Staff
Joined: 1/12/2009 Posts: 279 Points: 408 Location: VA
|
I actually did one of these recently:
EntreeListItemDataGrid dg = g.AddListItem<EntreeListItemDataGrid>();
EntreeDataGridRow r = null; EntreeDataGridCell c = null;
DataTable dt = UserData.GetUsers();
r = new EntreeDataGridRow(); r.Type = EntreeDataGridRowType.Header;
//--Create the Header row foreach (DataColumn col in dt.Columns) { c = new EntreeDataGridCell(); c.Value = col.ColumnName; r.Cells.Add(c); }
dg.Rows.Add(r);
//--Loop through and create all rows foreach (DataRow row in dt.Rows) { r = new EntreeDataGridRow(); foreach (DataColumn col in dt.Columns) { c = new EntreeDataGridCell(); if (col.ColumnName == "ID") c.Type = EntreeDataGridCellType.RowLabel; c.Value = row[col.ColumnName].ToString(); r.Cells.Add(c); } dg.Rows.Add(r); }
|
|
Rank: Advanced Member
Joined: 6/10/2011 Posts: 37 Points: 111 Location: Belgrade
|
Thanks Joe,
Work like a charm.
alex
|
|
Rank: Member
Joined: 5/20/2011 Posts: 4 Points: 12 Location: United States
|
Hi Joe, Is it possible to make cell values in the datagrid clickable? I tried a href, but it doesnt work.
thanks
|
|
 Rank: ME Staff
Joined: 1/12/2009 Posts: 279 Points: 408 Location: VA
|
The current version of the datagrid is read-only. In order to add clickactions to the cells, you'd have to modify the XSLT (or create a new one through a theme) for the datagrid control and add that capability there
-joe
|
|
|
Guest |