This is a migrated thread and some comments may be shown as answers.

Displaying total number of items in Footer Template not working

0 Answers 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Juan Paulo
Top achievements
Rank 1
Juan Paulo asked on 07 Jan 2011, 11:59 AM
Hi Telerik Team,

I need a little help on showing the item number in the footer template of the radcombobox. I have tried your demo in your website (see below) but the value of the Items.Count is not showing.. The way I bind my data is through looping to my collections and add the data by Items.Add method instead of DataBind() method. I did this approach for some reasons. Please help me.

    Protected Sub cboConsultant_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cboConsultant.ItemsRequested
        For Each user As Usr In Usr.GetPeerUsersForJob
            Dim item As New RadComboBoxItem
            item.Text = user.ContactName
            item.Value = user.UserId
            item.Attributes.Add("ContactEmail", user.ContactEmail)
            cboConsultant.Items.Add(item)
            item.DataBind()            
        Next

    End Sub

.vb:
 Protected Sub RadComboBox1_DataBound(sender as Object, e as EventArgs)
            'set the initial footer label
            CType(RadComboBox1.Footer.FindControl("RadComboItemsCount"), Literal).Text = Convert.ToString(RadComboBox1.Items.Count)
        End Sub

.aspx:
 <FooterTemplate>
            A total of
            <asp:Literal runat="server" ID="RadComboItemsCount" />
            items
        </FooterTemplate>

Regards,
masterlopau

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Juan Paulo
Top achievements
Rank 1
Share this question
or