Hello,
I am trying to add new row into C1WebGrid, I am following on the help, but it's not working..
to do SQLInsert, SQLUpdate, SQLDelete .. I use SQLDatasource and its bound to C1WebGrid
What I had:
Private Sub C1WebGrid1_ItemCreated(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1ItemEventArgs) Handles C1WebGrid1.ItemCreated
If e.Item.ItemType = C1.Web.C1WebGrid.C1ListItemType.Footer Then
Dim btnAdd As New LinkButton()
btnAdd.Text =
"Add New"
' add a handler for the click eventAddHandler btnAdd.Click, AddressOf AddNew_Click
e.Item.Cells(0).Controls.Add(btnAdd)
End If
End SubPublic Sub AddNew_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim mSQL As String = "SELECT * FROM DIVISION"Dim mAdapter As OracleDataAdapter = New OracleDataAdapter(mSQL, ClsFunctions.GetConnectionString)
Dim mDivision As DataSet = New DataSetmAdapter.Fill(mDivision, "Division")
Dim table As DataTable = mDivision.Tables(0)Dim row As DataRow = table.NewRow()
row.EndEdit()
table.Rows.Add(row)
Me.C1WebGrid1.EditItemIndex = table.Rows.Count - 1
Me.C1WebGrid1.DataBind()
End Sub