[
WebMethod]
public static RadComboBoxData GetCompanyNames(RadComboBoxContext context)
{
DataSet data = GetData(context.Text);
RadComboBoxData comboData = new RadComboBoxData();
int itemOffset = context.NumberOfItems;
int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Tables[0].Rows.Count);
comboData.EndOfItems = endOffset == data.Tables[0].Rows.Count;
List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(endOffset - itemOffset);
for (int i = itemOffset; i < endOffset; i++)
{
RadComboBoxItemData itemData = new RadComboBoxItemData();
itemData.Text = data.Tables[0].Rows[i][
"ClientName"].ToString();
itemData.Value = data.Tables[0].Rows[i][
"ClientId"].ToString();
result.Add(itemData);
}
comboData.Message = GetStatusMessage(endOffset, data.Tables[0].Rows.Count);
comboData.Items = result.ToArray();
return comboData;
}
protected void rcbClientName_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
DataSet data = GetData(e.Text);
int itemOffset = e.NumberOfItems;
int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Tables[0].Rows.Count);
e.EndOfItems = endOffset == data.Tables[0].Rows.Count;
for (int i = itemOffset; i < endOffset; i++)
{
RadComboBoxItemData itemData = new RadComboBoxItemData();
rcbClientName.Items.Add(
new RadComboBoxItem(data.Tables[0].Rows[i]["ClientName"].ToString(),
data.Tables[0].Rows[i][
"ClientName"].ToString()));
}
e.Message = GetStatusMessage(endOffset, data.Tables[0].Rows.Count);
}
private static string GetStatusMessage(int offset, int total)
{
if (total <= 0)
return "No Match";
return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
}
private static DataSet GetData(string text)
{
return TaxForms.GetClientNameAndId(text);
}
protected void btnSelectClient_Click(object sender, EventArgs e)
{
DisplaySelection(rcbClientName, txtClientId);
}
private void DisplaySelection(RadComboBox name, TextBox text)
{
txtClientId.Text = rcbClientName.SelectedValue;
}
<telerik:RadComboBox ID="RadComboPriority" runat="server" Width="280px" TabIndex="7" CssClass="blackText9" AllowCustomText="false"></telerik:RadComboBox>
'populating the RadComboBox on PageLoad
Public Sub LoadPriorities()
Dim description As String
Dim item As New RadComboBoxItem()
item.Text = ""
item.Value = 0
RadComboPriority.Items.Add(item)
Dim item1 As New RadComboBoxItem()
item1.Text = "1 - Immediate"
item1.Value = 1
description = "Use this code when you are not able to do your job."
ToolTipify(item1, description)
RadComboPriority.Items.Add(item1)
Dim item2 As New RadComboBoxItem()
item2.Text = "2 - Serious"
item2.Value = 2
description = "For when you are able to do your job, but you are limited by a problem."
ToolTipify(item2, description)
RadComboPriority.Items.Add(item2)
Dim item3 As New RadComboBoxItem()
item3.Text = "3 - Minor"
item3.Value = 3
description = "This code is used when you need help but can wait until the priority 1 and 2 work orders are handled first."
ToolTipify(item3, description)
RadComboPriority.Items.Add(item3)
End Sub
'adding tool tip to each item
Public Sub ToolTipify(ByVal item As RadComboBoxItem, ByVal description As String)
Dim tip As New RadToolTip()
item.Attributes.Add("ID", Guid.NewGuid().ToString())
tip.RelativeTo = ToolTipRelativeDisplay.Element
tip.Text = description
tip.TargetControlID = item.Attributes("ID")
tip.IsClientID = True
'tip.ShowEvent = ToolTipShowEvent.FromCode
'form1.Controls.Add(tip)
tip.VisibleOnPageLoad = True
tip.HideEvent = ToolTipHideEvent.LeaveToolTip
Me.Page.Form.Controls.Add(tip)
End Sub
I am unable to get the tool tips to display after the page has been posted back. Any help would be appreciated.
Thanks,
Cindy
<%
@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%
@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%
@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
I also downloaded the Telerik Samples that come with the documentation and didn't find this example in samplels, but basically, i'm looking for TreeView - Checkbox example/s
Thanks very much for any pointers