I have found an issue trying to change the content of a RadDock after the dock has been moved. Specifically, I can change the content with server-side code prior to moving the RadDock around on the page...after I move it, I get the following error:
Sys.InvalidOperationException: Two components with the same id 'RadDock1' can't be added to the application.
Here's the code for a very simple example is below. One RadDock and buttons.
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
<telerik:RadDock ID="RadDock1" runat="server" Width="300px">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</telerik:RadDock>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</telerik:RadAjaxPanel>
Clicking the button changes the text of the label inside the RadDock:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
label1.text =
"1"
End Sub
To demonstrate the bug: Load the page, click the button. The text inside the RadDock changes correctly. Now drag the RadDock to somewhere else on the page and click the button again. The JavaScript error listed above occurs.
Is this not correct use of this control? Is there something I'm missing?
Thanks,
david
<telerik:RadSpell ID="RadSpell1" Runat="server" ButtonType="LinkButton"
ControlToCheck="txtBox" Language="fr-FR" SupportedLanguages="fr-FR" DictionaryPath="~/App_Data/RadSpell/" CssClass="footertext" Skin="WebBlue" />

| Protected Sub RadToolTipManager2_AjaxUpdate(ByVal sender As Object, ByVal e As ToolTipUpdateEventArgs) |
| Dim aptId As IntegerInteger = Integer.Parse(e.TargetControlID.Split("_"C)(1)) |
| Dim apt As Appointment = RadScheduler1.Appointments(aptId) |
| Dim toolTip As AppointmentToolTip = DirectCast(LoadControl("AppointmentToolTip.ascx"), AppointmentToolTip) |
| toolTip.TargetAppointment = apt |
| e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip) |
| End Sub |
<telerik:RadTabStrip Skin = "Sunset" MultiPageID="RadMultiPage1" ID="RadTabStrip1" runat="server">
<Tabs>
<telerik:RadTab Text="General">
</telerik:RadTab>
<telerik:RadTab Text="Tools">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
<telerik:RadPageView ID = "RadPageView1" runat = "server" >
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table style="width:100%;">
<tr><td>Test 1</td><td> </td><td> </td></tr>
<tr><td colspan="3">
<telerik:RadGrid OnSortCommand="RadGrid1_SortCommand" AllowSorting="True"
AllowPaging = "true" PageSize = "5" AutoGenerateColumns = "False" ID="RadGrid1" runat="server"
Skin="Sunset" Width="275px" onneeddatasource="RadGrid1_NeedDataSource">
<MasterTableView DataKeyNames="customer_id" >
<Columns>
<telerik:GridBoundColumn DataField="customer_id" HeaderText="QA Number" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="customer_name" SortExpression = "customer_name" HeaderText="Can Reply" >
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<PagerStyle Mode="Slider"></PagerStyle>
</telerik:RadGrid>
</td></tr>
<tr><td> </td><td> </td><td> </td></tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView2" runat="server">
<table style="width:100%;">
<tr><td>Test 2</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td></tr>
</table>
</telerik:RadPageView>
</telerik:RadMultiPage>
ASPX.CSprotected void Page_Load(object sender, EventArgs e)
{
List<gen_customer> customers = (from c in db.gen_customers
where c.customer_id < 103
select c).ToList<gen_customer>();
RadGrid1.DataSource = customers;
RadGrid1.DataBind();
}
protected void RadGrid1_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)
{
if (!e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression))
{
GridSortExpression sortExpr = new GridSortExpression();
sortExpr.FieldName = e.SortExpression;
sortExpr.SortOrder =
GridSortOrder.Ascending;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
}
}
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
List<gen_customer> customers = (from c in db.gen_customers
where c.customer_id < 103
select c).ToList<gen_customer>();
RadGrid1.DataSource = customers;
}
Hello,
I am binding to an arraylist which contains object items with properties 'name' and 'val', when I call DataBind, ComboBo items are successfully created, but I'am unable to select one of the items.
It's so trivial that I'm thinking I have an error somewhere else, here is my code:
It runs in the Page_Load event of my page, not other interaction after.
The radCombo is not ajaxified, no autopostback.
| ArrayList ar = im.CategoryList; |
| RadComboCat.DataSource = ar; |
| RadComboCat.DataValueField = "val"; |
| RadComboCat.DataTextField = "name"; |
| RadComboCat.DataBind(); |
| if ( catId == 0 ) |
| { |
| RadComboCat.SelectedIndex = 0; |
| } |
| else |
| { |
| string strCat = catId.ToString(); |
| Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatComboSelected FindItemByValue: [{0}], catId:{1}",strCat,catId),CrmImageTrace.Sw.Info); |
| RadComboBoxItem it = RadComboCat.Items.FindItemByValue(strCat); |
| Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatComboSelected FindItemByValue found : {0}", it != null ),CrmImageTrace.Sw.Info); |
| if (it != null) |
| { |
| it.Selected = true; |
| Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatCombo Selected Item: {0}, catId:{1}",it.Text,catId),CrmImageTrace.Sw.Info); |
| } |
| } |
Trace shows that the it.Selected= true instruction is executed, but when page is displayed, nothing is selected.
When I select from the UI, the value is well selected and I can store it ????
What could be the reason ?
(Hollidays I know....)
Thanks
CS