在GridView中用DataTable,定义模板页,PostBack后TextBox值犹在,但dropDownList值没了,请高手解决......
首先模板类如下
======
public class MyTemplate : ITemplate
{
private SWT.Components.DataTableColumnInfo _DTColumnInfo;
private ListItemCollection _ListItems;
public MyTemplate(SWT.Components.DataTableColumnInfo toColumnInfo,ListItemCollection taItems)
{
this._DTColumnInfo = toColumnInfo;
this._ListItems = taItems;
}
public void InstantiateIn(Control toContainer)
{
if (this._DTColumnInfo.ControlTypeName == "TextBox ") {
string lcID = toContainer.ID;
lcID = toContainer.ClientID;
TextBox loEdtBox = new TextBox();
loEdtBox.ID = "edt " + this._DTColumnInfo.Name;
loEdtBox.EnableViewState = true;
loEdtBox.DataBinding += new EventHandler(this.OnDataBinding);
loEdtBox.Width = this._DTColumnInfo.Width;
toContainer.Controls.Add(loEdtBox);
if (this._DTColumnInfo.Type == "System.Int32 ") {
CompareValidator loCompareInteger = new CompareValidator();
loCompareInteger.ControlToValidate = loEdtBox.ID;
loCompareI