Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create New and Delete button on Web page
Message
From
13/02/2012 15:26:56
 
 
To
10/02/2012 16:37:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01535128
Message ID:
01535318
Views:
31
Here is where I am getting stuck.
I can't get the following code to work:
Private Sub btnAddDetail_Click(ByVal sender As System.Object, e As System.EventArgs) Handles btnAddDetail.Click
   ' Retrieve the previous Order Detail DataSet
   Dim dsOrderDetail As DataSet = CType(Session("dsOrderDetail"), DataSet)
   
   ' Add a new row to the DataSet
   Me.oOrderDetail.NewRow(dsOrderDetail, Me.oOrderDetail.TableName, New OrderDetailDefaults(Me.OrderID))
   
   ' Store the DataSet back into the session
   Session("dsOrderDetail") = dsOrderDetail
   
   ' Set the new row for editing
   Me.grdOrderDetail.EditIndex = dsOrderDetail.Tables(Me.oOrderDetail.TableName).Rows.Count - 1
   
   ' Rebind the DataGrid
   Me.BindControl(Me.grdOrderDetail)
End Sub
This line is giving me an error saying I have to have 'new' in it.
Me.grdOrderDetail.EditIndex = dsOrderDetail.Tables(Me.oOrderDetail.TableName).Rows.Count - 1
I don't know what the syntax should be.
Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform