I am creating a Dynamically built RadGrid. I have to do so because I am generating columns based on how many dates my sql query returns. I am placing the specific dates as header column groups. Under each date I am trying to create a dropdowncolumn that has a different datasource than the radGrid.
The problem is creating it dynamically. I thought about using an item template but how could I place a dropdown in the item template for each drop down that i need to create, which is two per date.
How do i bind the datasource for the DropDownColumn from code behind when the entire grid is dynamically built.
for (int t = 0; t < datecount; t++)
{
int utacount = Convert.ToInt32(getDrill.Rows[t][3].ToString());
for (int p = 0; p < datecount; p++)
{
GridDropDownColumn ddc = new GridDropDownColumn();
int b = p + 1;
ddc.UniqueName = "ddc" + p + s;
if (p - 1 < utacount)
{
string name = "uta" + p + s;
ddc.ColumnGroupName = name;
//ddc.DataField = "strStatus";
//ddc.ListTextField = "strStatus";
////GridEditableItem editedItem = ddc as GridEditableItem;
////GridEditManager editman = editedItem.EditManager;
////GridDropDownColumnEditor editor = editman.GetColumnEditor(name) as GridDropDownColumnEditor;
////editor.DataSource = getDrill;
////editor.DataBind();
}
grid.MasterTableView.Columns.Add(ddc);
}
s++;
}