|
-
Jun 30th, 2004, 03:37 PM
#1
Thread Starter
Fanatic Member
datagrid, datarows
Ok, i'm picking up a project for someone else, and its confusing me very badly.
We have a datagrid, and in the footer of each column, there is a texbox. Whichever row is selected, the values of each item in that row is displayed in the txtboxes in the footer. Kinda see where I'm going? When changes are made to the columns there is another button in the footer called ADD which changes the values of the dataset if the values of the textboxes were changed.
Here's some code, it looks like a mess to me and I'm highly confused by it.
Protected Sub OnInsert(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Dim drItem As DataRow()
Dim txtTemp As New TextBox()
drItem(0) = dsItems.Tables(0).NewRow
txtTemp = e.Item.FindControl("txtItemAdd")
drItem(1) = "test"
txtTemp = e.Item.FindControl("txtPriceAdd")
drItem(3) = txtTemp.Text
'txtTemp = e.Item.FindControl("txtQuantityAdd")
'drItem(4) = txtTemp.Text
'dsItems.Tables(0).Rows.InsertAt(drItem, 0)
'DataGrid1.DataSource = dsItems.Tables(0)
'DataGrid1.DataBind()
End Sub
PLEASE HELP! When I click the EDIT button to select the row, i get this error:
Object reference not set to an instance of an object
and it highlights the line:
drItem(0) = dsItems.Tables(0).NewRow
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|