D
Dan
I am having a problem with losing data from my datagrid after it posts back.
The page runs the populate data sub at the end of CreateChildControls and
fills my DataGrid. After I postback by clicking the cmdUpdate button, I
would expect oTable.Items.Count to have the same # it was before I did the
postback, but instead its zero.
Thanks for any help...
Below is some of the sample code:
Protected WithEvents oTable As New System.Web.UI.WebControls.DataGrid
Protected WithEvents cmdUpdate As New System.Web.UI.WebControls.LinkButton
Protected Overrides Sub CreateChildControls()
oTable.EnableViewState = True
Me.Controls.Add(oTable)
Me.Controls.Add(cmdUpdate)
End Sub
Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdUpdate.Click
sDebug = oTable.Items.Count
End Sub
Protected Overrides Sub RenderWebPart(ByVal output As
System.Web.UI.HtmlTextWriter)
Me.EnsureChildControls()
PopulateData()
......
End Sub
The page runs the populate data sub at the end of CreateChildControls and
fills my DataGrid. After I postback by clicking the cmdUpdate button, I
would expect oTable.Items.Count to have the same # it was before I did the
postback, but instead its zero.
Thanks for any help...
Below is some of the sample code:
Protected WithEvents oTable As New System.Web.UI.WebControls.DataGrid
Protected WithEvents cmdUpdate As New System.Web.UI.WebControls.LinkButton
Protected Overrides Sub CreateChildControls()
oTable.EnableViewState = True
Me.Controls.Add(oTable)
Me.Controls.Add(cmdUpdate)
End Sub
Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdUpdate.Click
sDebug = oTable.Items.Count
End Sub
Protected Overrides Sub RenderWebPart(ByVal output As
System.Web.UI.HtmlTextWriter)
Me.EnsureChildControls()
PopulateData()
......
End Sub