I am using TreeListView.
I am adding columns dynamically at runtime
GridViewDataColumn column;
for (int icnt = 1; icnt < ts.Days; icnt++)
{
column = new GridViewDataColumn();
column.UniqueName = "key" + icnt.ToString();
column.IsReadOnly = false;
RadTreeListView1.Columns.Add(column);
}
I am populating the cell data in RadTreeListView1_RowLoaded event.
var row = e.Row as TreeListViewRow;
foreach (GridViewCell cell in row.Cells)
{
if (cell.IsLoaded)
{
DateTime dates;
if (DateTime.TryParse(cell.Column.Header.ToString(), out dates))
{
string filter = "dates = '#" + dates.ToShortDateString().ToString() + "#'";
DataRow[] dr = lobjdt.Select(filter);
if (dr != null && dr.Length > 0)
{
cell.Content = dr[0]["hours"].ToString();
}
}
}
}
But I am facing one more diffrent problem.
I want to edit cells of cloumns which I have added dynamically.
I am able to click and edit the data ... but data gets disappeares when user leave the cell and click somewhere else in the window.
Editing is working correctly in static clumns.
Am I missing anything while adding columns ?