Author: igorbaldacci | Posted on: 10/9/2009 8:08:44 AM | Views : 282

I'm trying to add a new row in my GridView on click event of a button.
When I click the button, the new row replaces the old and It's not added (so I have ONLY one row each time).
I've tried to evaluate the "dtValues.Rows.Count" and it is ever = 1... it seems that my DataTable is ever initialized!
Where is the problem, please? 
 This is my code behind:
Dim dtValues As New DataTable Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load CreateDataTable() End Sub Protected Sub btnAggiungiCampo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAggiungiCampo.Click If txtNomeCampo.Text <> vbNullString Then Dim drValues As DataRow = dtValues.NewRow drValues("Nome Campo") = txtNomeCampo.Text drValues("Tipo Campo") = ddlTipoCampo.SelectedIt ...

Go to the complete details ...