G
Guest
Hello All!
I get this error at this line
Line 368: Len(e.Item.Cells(5).Text) - 1)
Line 369: txtQty.Text = e.Item.Cells(5).Text
****Line 370: chkEbay.Checked =
CType(e.Item.Cells(6).FindControl("chkEbay"), _****
Line 371: CheckBox).Checked
Line 372: chkSold.Checked =
CType(e.Item.Cells(7).FindControl("chkSold"), _
It comes up when I hit the Edit button on my data grid, here is my code for
that sub. Any thoughts?
Private Sub grdUinv_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
grdUinv.ItemCommand
If e.Item.ItemType = ListItemType.Pager Or _
e.Item.ItemType = ListItemType.Header Then Exit Sub
grdUinv.EditItemIndex = -1
Dim btn As Button = CType(e.CommandSource, Button)
If btn.Text = "Edit" Then
txbProductID.Text = e.Item.Cells(0).Text
txtProdName.Text = e.Item.Cells(1).Text
txtModNum.Text = e.Item.Cells(2).Text
txtSrp.Text = Microsoft.VisualBasic.Right(e.Item.Cells(3).Text, _
Len(e.Item.Cells(4).Text) - 1)
txtCost.Text = Microsoft.VisualBasic.Right(e.Item.Cells(4).Text, _
Len(e.Item.Cells(5).Text) - 1)
txtQty.Text = e.Item.Cells(5).Text
chkEbay.Checked = CType(e.Item.Cells(6).FindControl("chkEbay"), _
CheckBox).Checked
chkSold.Checked = CType(e.Item.Cells(7).FindControl("chkSold"), _
CheckBox).Checked
pnlAdd.Visible = True
Else
' DeleteItem(grdUinv.DataKeys(e.Item.ItemIndex).ToString)
End If
btnSave.CommandArgument = ""
End Sub
TIA!!!
Rudy
I get this error at this line
Line 368: Len(e.Item.Cells(5).Text) - 1)
Line 369: txtQty.Text = e.Item.Cells(5).Text
****Line 370: chkEbay.Checked =
CType(e.Item.Cells(6).FindControl("chkEbay"), _****
Line 371: CheckBox).Checked
Line 372: chkSold.Checked =
CType(e.Item.Cells(7).FindControl("chkSold"), _
It comes up when I hit the Edit button on my data grid, here is my code for
that sub. Any thoughts?
Private Sub grdUinv_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
grdUinv.ItemCommand
If e.Item.ItemType = ListItemType.Pager Or _
e.Item.ItemType = ListItemType.Header Then Exit Sub
grdUinv.EditItemIndex = -1
Dim btn As Button = CType(e.CommandSource, Button)
If btn.Text = "Edit" Then
txbProductID.Text = e.Item.Cells(0).Text
txtProdName.Text = e.Item.Cells(1).Text
txtModNum.Text = e.Item.Cells(2).Text
txtSrp.Text = Microsoft.VisualBasic.Right(e.Item.Cells(3).Text, _
Len(e.Item.Cells(4).Text) - 1)
txtCost.Text = Microsoft.VisualBasic.Right(e.Item.Cells(4).Text, _
Len(e.Item.Cells(5).Text) - 1)
txtQty.Text = e.Item.Cells(5).Text
chkEbay.Checked = CType(e.Item.Cells(6).FindControl("chkEbay"), _
CheckBox).Checked
chkSold.Checked = CType(e.Item.Cells(7).FindControl("chkSold"), _
CheckBox).Checked
pnlAdd.Visible = True
Else
' DeleteItem(grdUinv.DataKeys(e.Item.ItemIndex).ToString)
End If
btnSave.CommandArgument = ""
End Sub
TIA!!!
Rudy