Hello,
I am currently working on a project with a RadSearchBox .
VB.NET:
ASPX:
How can I prevent the RadSearchBox from displaying items
whose description is empty?
I’ll be glad for help,
Daniel.
I am currently working on a project with a RadSearchBox .
VB.NET:
01.Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load02. Dim User_Report As New DataTable03. Session("User_Report") = GenTreeData(User_Report)04. 05. RadSearchBox1.DataTextField = "Name"06. RadSearchBox1.DataValueField = "ID"07. RadSearchBox1.DataSource = CType(Session("User_Report"), DataTable)08. RadSearchBox1.DataBind()09. 10.End Sub11. 12.Private Function GenTreeData(User_Report As DataTable) As DataTable13. 14. User_Report.Columns.Add("Section")15. User_Report.Columns.Add("ID")16. User_Report.Columns.Add("Parent_ID")17. User_Report.Columns.Add("Description")18. User_Report.Columns.Add("Name")19. 20. User_Report.Rows.Add("1", "101_1", "-1-1", "dedcrip", "xxxxxxx")21. User_Report.Rows.Add("1", "101_2", "-1-1", "dedcrip", "vvvvv")22. User_Report.Rows.Add("-1", "102_1", "-1-1", "dedcrip", "ccc")23. User_Report.Rows.Add("1", "-2-2", Nothing, Nothing, "ddd")24. User_Report.Rows.Add("1", "-3-3", "-1-1", Nothing, "ddd")25. User_Report.Rows.Add("1", "102_2", "-2-2", "dedcrip", "hhhhh")26. User_Report.Rows.Add("2", "101_3", "-2-2", "dedcrip", "lll")27. User_Report.Rows.Add("2", "-1-1", Nothing, Nothing, "ooooo")28. User_Report.Rows.Add("1", "101_4", "-3-3", "dedcrip", "zzzzz")29. User_Report.Rows.Add("1", "102_3", "-3-3", "dedcrip", "zzzzz")30. User_Report.Rows.Add("1", "102_4", "-3-3", "dedcrip", "zzzzz")31. User_Report.Rows.Add("1", "102_5", "-1-1", "dedcrip", "zzzzz")32. Return User_Report33.End FunctionASPX:
<telerik:RadSearchBox ID="RadSearchBox1" runat="server" EmptyMessage="search" EnableAutoComplete="true"> <DropDownSettings Height="550px" Width="400px"> <ItemTemplate> <div class="search-report-box"> <span id="serach-report-name"><%# DataBinder.Eval(Container.DataItem, "Name")%></span><br /> <span id="search-report-category"><%# DataBinder.Eval(Container.DataItem, "Description")%></span> </div> </ItemTemplate> </DropDownSettings> </telerik:RadSearchBox>How can I prevent the RadSearchBox from displaying items
whose description is empty?
I’ll be glad for help,
Daniel.