G
Guest
j9 (Programmer) Feb 15, 2005
I have a datagrid with an arraylist as the datasource. I added an Edit,
Update, Cancel button column and coded the EditCommand event handler. When I
click on the Edit button, the datagrid disappears. Have I lost my datasource
during postbacks or something? Here's my code:
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
PopulateForm();
}
}
private void PopulateForm()
{
dgReferences.DataSource = mySOP.Refs;//(mySOP.Refs is an arraylist)
dgReferences.DataKeyField = "RefID";
dgReferences.DataBind();
}
private void dgReferences_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
dgReferences.EditItemIndex = e.Item.ItemIndex;
dgReferences.DataBind();
}
I have a datagrid with an arraylist as the datasource. I added an Edit,
Update, Cancel button column and coded the EditCommand event handler. When I
click on the Edit button, the datagrid disappears. Have I lost my datasource
during postbacks or something? Here's my code:
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
PopulateForm();
}
}
private void PopulateForm()
{
dgReferences.DataSource = mySOP.Refs;//(mySOP.Refs is an arraylist)
dgReferences.DataKeyField = "RefID";
dgReferences.DataBind();
}
private void dgReferences_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
dgReferences.EditItemIndex = e.Item.ItemIndex;
dgReferences.DataBind();
}