Private Sub RadGridView1_UserAddingRow(ByVal sender As Object,
ByVal e As Telerik.WinControls.UI.GridViewRowCancelEventArgs) Handles RadGridView1.UserAddingRow
Try
'There might be more than one row
For Each oRow As GridViewDataRowInfo In e.Rows
Dim strPrcLevel As String = oRow.Cells("prclevel").Value
Dim strItemNumber As String = oRow.Cells("itemnmbr").Value
Dim strUofM As String = oRow.Cells("UofM").Value
Dim decUnitPrice As Decimal = oRow.Cells("unitprce").Value
'validate
If strPrcLevel = "" Then
GlobalMessageBox("Invalid price level")
e.Cancel = True
Exit Sub
End If
If strItemNumber = "" Then
GlobalMessageBox("Invalid itemnmbr")
e.Cancel = True
Exit Sub
End If
'data access code.
'We use the DynDeveloper Data Access classes, located here:
'http://dyndeveloper.com/Menus/SQLScriptsThatWriteScripts.aspx
SPs.FP_IV00108QuotedPrices_INS(strPrcLevel, strItemNumber, strUofM, decUnitPrice, appUser.Db).execute()
Next
Catch ex As Exception
GlobalErrorHandler(ex)
End Try
End Sub
Code to get the data in the new row:
intMasterOrderItemFK = Me.RadGridView1.MasterView.TableAddNewRow.Cells("intMasterOrderItemFK").Value