RadListBox and SelectedItems

2 posts, 0 answers
  1. Sophie
    Sophie avatar
    4 posts
    Member since:
    Jun 2016

    Posted 28 Jun Link to this post

    Hi,

    I am using a RadListBox and I would like to find if the items that are selected in this list when clicking on a search button. However, when doing the following I have no item selected (the Label text is = 0) and I do not see why?

     

    In my Search.ascx:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Search.ascx.cs" Inherits="Controls.Search.Search" %>

    <telerik:RadListBox ID="List1" runat="server" SelectionMode="Multiple" CssClass="rListBx"/>

     

    In my Search.ascx.cs:

    Label.Text = List1.SelectedItems.Count().ToString();

    My Search_Click function is in a partial class that inherits from System.Web.UI.UserControl 

     

    In my Search.ascx.designer.cs

    protected global::Telerik.Web.UI.RadListBox List1;

     

    An idea about what I am doing wrong here?

    Thanks

     

     

  2. Sophie
    Sophie avatar
    4 posts
    Member since:
    Jun 2016

    Posted 29 Jun in reply to Sophie Link to this post

    To resolve the problem I replaced Page_Load by Page_Init...

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top