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
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