ComboBox Multi column with linq

3 posts, 0 answers
  1. daouddajani
    daouddajani avatar
    6 posts
    Member since:
    Apr 2007

    Posted 07 May 2008 Link to this post

    i need to bind the combo box to a linq datasouce and when clicked it show a 2 cols dropdown.

    i keep getting error message on the e.Item.DataItem conversion what should the ????? be ?

    Protected Sub RdProviders_ItemDataBound(ByVal sender As Object, ByVal e As RadComboBoxItemEventArgs)

    Dim ds As New mobilesdcDataContext

    e.Item.Text =

    DirectCast(e.Item.DataItem, ?????)("ProviderExtension").ToString() + "; " + (DirectCast(e.Item.DataItem, ??????))("ProviderName").ToString()

    e.Item.Value = (

    DirectCast(e.Item.DataItem, ?????))("ProviderExtension").ToString()

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    If Not Page.IsPostBack Then

    Dim ds As New mobilesdcDataContext

    Dim result = From p In ds.Providers_tbls Select p

    rbProviders.DataSource = result.ToList

    rbProviders.DataTextField =

    "ProviderName"

    rbProviders.DataValueField =

    "ProviderExtension"

    rbProviders.DataBind()

    End If

    End Sub

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 May 2008 Link to this post

    Hi,

    Go through the online demo given below.
    Multi-column Combo

    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 07 May 2008 Link to this post

    Hi ,

    e.Item.DataItem has to be converted to  DataRowView object.

    Example:
    (DirectCast(e.Item.DataItem, DataRowView))

    Regards,
    Rosi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top