RadDropDownList - Retrieve additional values from the datasource

Working with Telerik’s RadDropDownList is usually straightforward—until you need it to return more than one value. Many developers assume the control can only store a single DataValueField, and attempts to retrieve additional fields through DataItem often fail, especially after postbacks. The good news is that Telerik quietly provides a clean, reliable way to attach and retrieve multiple values from each item without hacks, hidden fields, or brittle string parsing. In this article, we’ll walk through the method that actually works every time and show why it’s the preferred approach for real-world ASP.NET applications.

Bind the dropdown normally

ddlPlant2.DataSource = oDT
ddlPlant2.DataValueField = "plant"
ddlPlant2.DataTextField = "VendNamePlant"
ddlPlant2.DataBind()

Handle the ItemDataBound like this. All the fields in the data set are available in e.Item.DataItem

Protected Sub RadDropDownList1_ItemDataBound(sender As Object, e As DropDownListItemEventArgs) Handles ddlPlant2.ItemDataBound
    Dim strError As String = ""
 
    Try
        Dim dataItem As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
        Dim strVendorID As String = dataItem("VendorID").ToString()
        e.Item.Attributes("VendorID") = strVendorID
 
    Catch ex As Threading.ThreadAbortException
    Catch ex As Exception
        ErrorHandler.globalErrorHandler(ex, strError, App.AppName, App.UserName, False)
        Me.lblError.Text = ex.Message
    End Try
 
End Sub

Retrieve the values like this:

Private Sub ddlPlant2_SelectedIndexChanged(sender As Object, e As DropDownListEventArgs) Handles ddlPlant2.SelectedIndexChanged
    Session("Plant") = ddlPlant2.SelectedValue
 
    Dim item = ddlPlant2.SelectedItem
 
    Dim strVendorID = item.Attributes("VendorID")
 
End Sub

 

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences