N
news.skynet.be
Hi;
I have the following code:
(...)
Sub MyDataGrid_Edit(sender As Object, e As DataGridCommandEventArgs)
MyDataGrid.EditItemIndex = e.Item.ItemIndex
BindGrid()
End Sub 'MyDataGrid_Edit
Sub MyDataGrid_Cancel(sender As Object, e As DataGridCommandEventArgs)
MyDataGrid.EditItemIndex = - 1
BindGrid()
End Sub 'MyDataGrid_Cancel
Sub MyDataGrid_Update(sender As Object, e As DataGridCommandEventArgs)
' For bound columns, the edited value is stored in a TextBox.
' The TextBox is the 0th element in the column's cell.
Dim qtyText As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox)
Dim priceText As TextBox = CType(e.Item.Cells(3).Controls(0),
TextBox)
Dim item As String = e.Item.Cells(1).Text
Dim qty As String = qtyText.Text
Dim price As String = priceText.Text
End Sub
(...)
After clicking on the "Edit" link of my datagrid. The whole row goes in edit
mode. Each cell has a textbox.
I have filled in some data in each cell and press the update button...
The Update event is raised. But now I have a problem. The qtyText.Text and
priceText.Text are always empty !!!
Any idea what I do wrong?
I have the following code:
(...)
Sub MyDataGrid_Edit(sender As Object, e As DataGridCommandEventArgs)
MyDataGrid.EditItemIndex = e.Item.ItemIndex
BindGrid()
End Sub 'MyDataGrid_Edit
Sub MyDataGrid_Cancel(sender As Object, e As DataGridCommandEventArgs)
MyDataGrid.EditItemIndex = - 1
BindGrid()
End Sub 'MyDataGrid_Cancel
Sub MyDataGrid_Update(sender As Object, e As DataGridCommandEventArgs)
' For bound columns, the edited value is stored in a TextBox.
' The TextBox is the 0th element in the column's cell.
Dim qtyText As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox)
Dim priceText As TextBox = CType(e.Item.Cells(3).Controls(0),
TextBox)
Dim item As String = e.Item.Cells(1).Text
Dim qty As String = qtyText.Text
Dim price As String = priceText.Text
End Sub
(...)
After clicking on the "Edit" link of my datagrid. The whole row goes in edit
mode. Each cell has a textbox.
I have filled in some data in each cell and press the update button...
The Update event is raised. But now I have a problem. The qtyText.Text and
priceText.Text are always empty !!!
Any idea what I do wrong?