This is a migrated thread and some comments may be shown as answers.

RadComboBox SelectedValue and Text

1 Answer 66 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
John Thompson
Top achievements
Rank 1
John Thompson asked on 08 Nov 2011, 09:09 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 11 Nov 2011, 09:24 AM
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
Tags
ComboBox
Asked by
John Thompson
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or