Hi I have followed the example on adding an item to the combobox on the client side.
http://www.telerik.com/help/aspnet-ajax/combo_itemsclientside.html
And it works, but when this happens I loose all other items in the combobox and only the item I haved added is there.
Here is my code:
function
AddNewItem(Text, Value)
{
var combo = $find('<%=rcbPerson.ClientID %>');
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(Text);
comboItem.set_value(Value);
combo.trackChanges();
combo.get_items().add(comboItem);
comboItem.select();
combo.commitChanges();
comboItem.scrollIntoView();
}
any help would be great
thanks,
Andrew Day
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestApp.WebApplication.Test" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="EmployeeSearchRadComboBox" Runat="server" |
| AllowCustomText="True" EnableLoadOnDemand="True" ShowToggleImage="False" |
| onitemsrequested="EmployeeSearchRadComboBox_ItemsRequested" |
| ShowDropDownOnTextboxClick="False" Skin="Gray" Width="167px" TabIndex="1" AppendDataBoundItems="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </telerik:RadComboBox> |
| </div> |
| <asp:ListBox ID="EmployeeListBox" runat="server" SelectionMode="Multiple" |
| EnableViewState="False" CssClass="EmployeeListBox" Rows="10" TabIndex="2" Width="167px"></asp:ListBox> |
| </form> |
| </body> |
| </html> |
| namespace TestApp.WebApplication |
| { |
| public partial class Test : System.Web.UI.Page |
| { |
| DataTable employeeInfo; |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| EmployeeSearchRadComboBox.Items.Add(new RadComboBoxItem("test1", "1")); |
| EmployeeSearchRadComboBox.Items.Add(new RadComboBoxItem("test2", "2")); |
| EmployeeSearchRadComboBox.Items.Add(new RadComboBoxItem("test3", "3")); |
| EmployeeSearchRadComboBox.Items.Add(new RadComboBoxItem("test4", "4")); |
| DataSet ds = new DataSet(); |
| employeeInfo = ds.Tables.Add(); |
| employeeInfo.Columns.Add("Name", Type.GetType("System.String")); |
| employeeInfo.Columns.Add("ID", Type.GetType("System.String")); |
| employeeInfo.Rows.Add("test5", "5"); |
| employeeInfo.Rows.Add("test6", "6"); |
| employeeInfo.Rows.Add("test7", "7"); |
| employeeInfo.Rows.Add("test8", "8"); |
| employeeInfo.Rows.Add("test9", "9"); |
| employeeInfo.Rows.Add("test10", "10"); |
| } |
| protected void EmployeeSearchRadComboBox_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) |
| { |
| if (e.Text.Equals("test")) |
| { |
| EmployeeSearchRadComboBox.DataSource = employeeInfo; |
| EmployeeSearchRadComboBox.DataTextField = "Name"; |
| EmployeeSearchRadComboBox.DataValueField = "ID"; |
| EmployeeSearchRadComboBox.DataBind(); |
| } |
| } |
| } |
| } |
Hi my problem is that I have a page with a Label that looks fine when i view the page, but when I open it in a RadWindow it doesnt look the same.
I have narrowed it down to being a problem with the CSS.
test.aspx
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <style type="text/css"> |
| .TemplateSubHeader |
| { |
| font-family: Verdana, Geneva, sans-serif !important; |
| font-size: 16px !important; |
| font-style: normal !important; |
| font-weight: normal !important; |
| color: #365D9D !important; |
| text-decoration: none !important; |
| margin: 0px !important; |
| clip: rect(auto,auto,auto,auto) !important; |
| line-height: 35px !important; |
| padding-bottom: 15px !important; |
| } |
| </style> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <asp:Label SkinID="TemplateSubHeader" ID="Label2" runat="server" Text="Name" ></asp:Label> |
| <p class="TemplateSubHeader" style="font-family: Verdana, Geneva, sans-serif !important;font-size: 16px !important;font-style: normal !important;font-weight: normal !important;color: #365D9D !important;text-decoration: none !important;margin: 0px !important;clip: rect(auto,auto,auto,auto) !important;line-height: 35px !important;padding-bottom: 15px !important;">Name</p> |
| </div> |
| </form> |
| </body> |
| </html> |
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| PopUp.NavigateUrl = test.aspx"; |
| PopUp.Visible = true; |
| PopUp.Width = 800; |
| PopUp.Height = 600; |
| PopUp.Modal = false; |
| PopUp.Overlay = true; |
| PopUp.VisibleStatusbar = false; |
| PopUp.VisibleTitlebar = true; |
| PopUp.Title = "Opret galleri"; |
| PopUp.Style.Add(HtmlTextWriterStyle.ZIndex, "1000"); |
| PopUp.Animation = Telerik.Web.UI.WindowAnimation.Fade; |
| PopUp.VisibleOnPageLoad = true; |
| } |
| <telerik:RadToolTipManager ID="RadTM" runat="server" Skin="Office2007" AutoTooltipify="true" /> |
var
_29=_28.getClientRects();
I can achieve errorless behavior of RadGrid commands by removing of RadToolTipManager from the page. But I do not want to do it.
Does anybody know where is the problem?