RadComboBox SelectedValue and Text

2 posts, 0 answers
  1. John Thompson
    John Thompson avatar
    5 posts
    Member since:
    Oct 2009

    Posted 08 Nov 2011 Link to this post

    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

    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
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 11 Nov 2011 Link to this post

    Hello John,

    Since you have opened a support ticket regarding this issue, my suggestion is to continue the discussion there.

    Greetings,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top