The template displays just fine, but of course there is no sorting. Now that I think about it is there a way I could hook up column resize, and reorder?
var col = new GridTemplateColumn
{
ItemTemplate =
new DetailTemplate(),
UniqueName =
"Detail",
};
col.HeaderTemplate =
new DetailHeaderTemplate();
RadGrid1.Columns.Add(col);
PlaceHolder1.Controls.Add(RadGrid1);
public
class DetailHeaderTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
var table = new Table { CellPadding = 0, CellSpacing = 0 };
table.Style.Add(
"width", "100%");
table.Style.Add(
"border", "1px");
var row = new TableRow();
var cell = new TableCell();
cell.Style.Add(
"width","33%");
cell.Text =
"Desc";
row.Cells.Add(cell);
cell =
new TableCell();
cell.Style.Add(
"width", "33%");
cell.Text =
"Dist #";
row.Cells.Add(cell);
cell =
new TableCell();
cell.Style.Add(
"width", "33%");
cell.Text =
"Price";
row.Cells.Add(cell);
table.Rows.Add(row);
container.Controls.Add(table);
}
}