为DataGrid动态创建模板列,首先要实现ITemplate接口:
public
class
MyDataGridTemplate : System.Web.UI.ITemplate
... {
ListItemType _litType;
object _objData;
public MyDataGridTemplate(ListItemType litType, object objData)
...{
_litType = litType;
_objData = objData;
}
public
... {
ListItemType _litType;
object _objData;
public MyDataGridTemplate(ListItemType litType, object objData)
...{
_litType = litType;
_objData = objData;
}
public