DropDown in SearchBox not shown (AutoCompleteBox)

2 posts, 1 answers
  1. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 30 Mar 2014 Link to this post

    I try to set a search box from list

    however when I put words into the search box it is not showed a drop-down (AutoComplete) list with a proper result

    I'll be glad for your help


    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
               <telerik:RadSearchBox ID="RadSearchBox1" runat="server" Width="250"
                   <DropDownSettings Height="150" Width="250" />
           <br />
           <br />
           <br />
           <br />
           <br />
           <br />
           <br />
           <br />
           <telerik:RadTreeView ID="RadTreeView1" Runat="server">

    Imports Telerik.Web.UI
    Public Class searchTest
        Inherits System.Web.UI.Page
        Dim listreports As New List(Of SiteDataItem)()
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
            End If
            ' RadSearchBox1.DataTextField = "Text"
            ' RadSearchBox1.DataValueField = "ReportID"
            RadSearchBox1.DataSource = listreports
        End Sub
        Friend Class SiteDataItem
            Private text1 As String
            Private id1 As Integer
            Private parentId1 As Integer
            Private reportId1 As String
            Public Property Text() As String
                    Return text1
                End Get
                Set(ByVal value As String)
                    text1 = value
                End Set
            End Property
            Public Property ID() As Integer
                    Return id1
                End Get
                Set(ByVal value As Integer)
                    id1 = value
                End Set
            End Property
            Public Property ParentID() As Integer
                    Return parentId1
                End Get
                Set(ByVal value As Integer)
                    parentId1 = value
                End Set
            End Property
            Public Property ReportID() As String
                    Return reportId1
                End Get
                Set(ByVal value As String)
                    reportId1 = value
                End Set
            End Property
            Public Sub New(ByVal id As Integer, ByVal parentId As Integer, ByVal text As String, Optional ByVal reportId As String = "99")
                Me.id1 = id
                Me.parentId1 = parentId
                Me.text1 = text
                Me.reportId1 = reportId
            End Sub
        End Class
        Private Sub BindToIEnumerable(ByVal treeView As RadTreeView)
            Dim siteData As New List(Of SiteDataItem)()
            siteData.Add(New SiteDataItem(1, 0, "Location"))
            siteData.Add(New SiteDataItem(2, 0, "func 1"))
            siteData.Add(New SiteDataItem(3, 0, "func  behavior"))
            siteData.Add(New SiteDataItem(4, 0, "func 4"))
            siteData.Add(New SiteDataItem(5, 0, "Additional reports"))
            siteData.Add(New SiteDataItem(6, 0, "func 5 "))
            siteData.Add(New SiteDataItem(7, 0, "func 6"))
            siteData.Add(New SiteDataItem(8, 0, "example 5"))
            siteData.Add(New SiteDataItem(9, 0, "Raw events"))
            siteData.Add(New SiteDataItem(10, 0, "Care"))
            siteData.Add(New SiteDataItem(11, 0, "Raw events"))
            siteData.Add(New SiteDataItem(12, 0, "Working Reports", ))
            siteData.Add(New SiteDataItem(13, 12, "Sunday ", "101"))
            siteData.Add(New SiteDataItem(14, 12, "Monday", "102"))
            siteData.Add(New SiteDataItem(15, 12, "Summery", "103"))
            siteData.Add(New SiteDataItem(16, 12, "Friday", "104"))
            siteData.Add(New SiteDataItem(17, 0, "New MultiLanguea Report", "105"))
            treeView.DataTextField = "Text"
            treeView.DataFieldID = "ID"
            treeView.DataFieldParentID = "ParentID"
            treeView.DataValueField = "ReportID"
            treeView.DataSource = siteData
            listreports = siteData
        End Sub
        Protected Sub RadTreeView1_NodeClick(sender As Object, e As RadTreeNodeEventArgs) Handles RadTreeView1.NodeClick
            Session("Report_ID") = e.Node.Value
        End Sub
        Protected Sub RadSearchBox1_Search(sender As Object, e As SearchBoxEventArgs) Handles RadSearchBox1.Search
        End Sub
    End Class

  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2014 in reply to Daniel Link to this post

    Hi Daniel,

    Please do the following modification in your Page_Load event which works fine at my end.

    VB.NET :
    Protected Sub Page_Load(sender As Object, e As EventArgs)
        RadSearchBox1.DataSource = listreports
    End Sub

  3. DevCraft R3 2016 release webinar banner
Back to Top