In a previous verion of Telerik controls, the following code worked, but it no longer does. Can anyone help? Both CustC and CustAN now return a blank value
The code for the ascx page is as follows:
Private Sub RadGrid2_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.InsertCommand
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim isCustCode As Boolean = False
'Dim intAutoNumber As Integer = CType(editedItem.FindControl("AutoNumber"), TextBox).Text
'Dim strActivity As String = CType(editedItem.FindControl("Activity"), TextBox).Text
Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
Dim CustC As String = CType(MyUserControl.FindControl("rcCustomer"), RadComboBox).Text
Dim CustAN As String = CType(MyUserControl.FindControl("rcCustomer"), RadComboBox).SelectedValue
The code for the ascx page is as follows:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
dsCustomers.Clear()
Dim strSPName1 As String = ""
If (Session("SalesPersonID") = "0" And Session("CSRID") <> "0") Or Session("SalesPersonID") = "999" Or Session("EstimatorID") <> "0" Then
strSPName1 = "GetCustomersActivity"
ElseIf Session("SalesPersonID") <> "0" Then
strSPName1 = "GetCustomersActivitySales"
End If
If strSPName1 = "" Then
strSPName1 = "GetCustomersActivity"
End If
Dim cmd1 As New SqlCommand(strSPName1, myConnection2)
cmd1.CommandType = CommandType.StoredProcedure
If (Session("SalesPersonID") = "0" And Session("CSRID") <> "0") Or Session("SalesPersonID") = "999" Or Session("EstimatorID") <> "0" Then
ElseIf Session("SalesPersonID") <> "0" Then
cmd1.Parameters.Add(New SqlParameter("@SalesPersonID", Session("SalesPersonID")))
End If
dtAdapter2.SelectCommand = cmd1
dtAdapter2.Fill(dsCustomers)
dvCustomers = New DataView(dsCustomers.Tables(0))
Me.dvCustomers.AddNew.Item("CustName") = " "
Me.dvCustomers.AddNew.Item("CustName") = " "
Me.dvCustomers.Sort = "CustName"
Me.dsCustomers.AcceptChanges()
rcCustomer.ClearSelection()
rcCustomer.DataTextField = "CustName"
rcCustomer.DataValueField = "CustName"
rcCustomer.DataSource = dvCustomers
rcCustomer.DataBind()
End Sub