Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
254 views
Hello, this is the error i got , when i try to go to the page.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
            System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +2108046
            Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +123
            [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
            Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +171
            Telerik.Web.UI.RadAjaxControl.PerformRender() +418
            Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1222
            Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +87
            System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
            System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
            System.Web.UI.Page.Render(HtmlTextWriter writer) +26
            System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
            System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
            System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
            System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
            

i searched it in forums, an answer tells that this is a javascript error and try moving the code from <head> to <body> ,but since i used a masterpage, i can't do this, is there any answer for this?
help will be appriciated :)
Missing User
 answered on 15 Aug 2008
1 answer
131 views
Hi,

 I am using grid control I understood how to work with different column types but my problem is I have to create a column whose column header also has a checkbox. I dont want client selection in the rows below (they should be read only)but check box at column header should be checked or unchecked by client at run time. is this possible?

Thanks.
Iana Tsolova
Telerik team
 answered on 15 Aug 2008
2 answers
153 views
Hi,

I would like to render the remove and add buttons as links rather than buttons, is this possible?

I don't think the add button is such a problem as i can just add javascript to an anchor to call the addFileInput method.  The problem I am having is with creating a remove link, I will still render a remove link per file input, but how do you track or get the index to call the deleteFileInputAt method?  Can you give me an example, I can't seem to figure out how your remove button works?

I currently have:

function OnClientAddedHandler(upload, eventArgs) {  
            if (upload.get_controlObjectsVisibility()) {  
                var row = eventArgs.get_row();  
                var removeRowLink = document.createElement("a");  
                removeRowLink.href = WHAT DO I PUT HERE??  
                removeRowLink.title = "remove file";  
                removeRowLink.innerHTML = "remove";  
                row.appendChild(removeRowLink);  
            }  
        } 

Am I going in the right direction here?

Thanks,

Jeff
Jeff
Top achievements
Rank 1
 answered on 15 Aug 2008
1 answer
117 views

Hi,
I can edit radgrid In Forms Editing Mode, then I can update all columns but I have problem with one column. "HİZMET KODU" column like "Products" have many items so user have to select on modal products form, instead of write product name manually.  I can not open radwindow on RadGrid. On the screenshot , I only open javascript modal window, but ı cant set value from this modal form to the radgrid edit form textbox. Are there any example for this situation ?

http://img393.imageshack.us/my.php?image=telerikkh4.jpg

Here is the source code:
<telerik:RadGrid ID="RadGrid1" runat="server"  Skin="Inox" AllowPaging="True" AllowSorting="True"
                     AutoGenerateColumns="False" Width="97%" OnNeedDataSource="RadGrid1_NeedDataSource"
                     AllowAutomaticDeletes="True"  AllowAutomaticUpdates="True"
                     OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"
                     OnUpdateCommand="RadGrid1_UpdateCommand" OnDataBound="RadGrid1_DataBound" OnItemCreated="RadGrid1_ItemCreated" >
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <MasterTableView DataKeyNames="ORLREF" GridLines="None" Width="100%" CommandItemDisplay ="Top" >
        <Columns>
            <telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"
                        ImageUrl="images/Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="ORLREF" HeaderText="REF NO." UniqueName="ORLREF" ReadOnly="True">
            </telerik:GridBoundColumn>
           
            <telerik:GridTemplateColumn  HeaderText="HİZMET KODU" UniqueName="CODE">
                <EditItemTemplate>
                    <telerik:RadTextBox ID="textbox1" runat="server" Text='<%# Bind("CODE")%>'></telerik:RadTextBox>
                    <asp:Button Runat="server" ID="ServerButton" Text="Show dialog" cssclass="button" style="width:250px;" OnClick="ServerButton_Click"></asp:Button>
                </EditItemTemplate>
               
                <ItemTemplate>    
                    <%#Eval("CODE")%>    
                </ItemTemplate>
            </telerik:GridTemplateColumn>
           
            <telerik:GridBoundColumn DataField="DEFINITION_" HeaderText="A&#199;IKLAMASI" UniqueName="DEFINITION_">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AMOUNT" HeaderText="MİKTAR" UniqueName="AMOUNT">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRICE" HeaderText="BİRİM FİYAT" UniqueName="PRICE">
            </telerik:GridBoundColumn>
           
            <telerik:GridTemplateColumn HeaderText="KDV DAHİL/HARİ&#199;" UniqueName="KDV">
                 <EditItemTemplate>    
                    <telerik:RadComboBox ID="RadComboBox1" AppendDataBoundItems="true" Height="200px" runat="server"    
                    DataTextField="KDV" DataValueField="KDV" SelectedValue='<%# Bind("KDV")%>'>     
                        <Items>    
                            <telerik:RadComboBoxItem Text="" Value="" />
                            <telerik:RadComboBoxItem Text="Hariç" Value="HARİÇ" />    
                            <telerik:RadComboBoxItem Text="Dahil" Value="DAHİL" />
                        </Items>    
                    </telerik:RadComboBox>    
                </EditItemTemplate>    
                <ItemTemplate>    
                    <%#Eval("KDV")%>    
                </ItemTemplate>  
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="VAT" HeaderText="KDV ORANI" UniqueName="VAT">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TOTAL" HeaderText="TUTAR" UniqueName="TOTAL" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SPECODE" HeaderText="FATURALANACAK" UniqueName="SPECODE">
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
        </Columns>
        <EditFormSettings ColumnNumber="2" CaptionFormatString="Satırı D&#252;zenle {0}" CaptionDataField="LOGICALREF">
            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
            <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />
            <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />
            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
            <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>
                <EditColumn UpdateText="G&#252;ncelle" UniqueName="EditCommandColumn1" CancelText="D&#252;zenlemekten Vazge&#231;">
                </EditColumn>
            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
        </EditFormSettings>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <CommandItemSettings AddNewRecordText="Yeni Kayıt Ekle" />
    </MasterTableView>
    </telerik:RadGrid>

CodeBehind Source Code

protected

void ServerButton_Click(object sender, EventArgs e)

{

string popupScript = "<script language='javascript'>" +

"window.showModalDialog('SrvCards.aspx', 'CustomPopUp','dialogWidth:255px;dialogHeight:250px;scrollbars=yes'); " +

"</script>";

Page.RegisterStartupScript(

"PopupScript", popupScript);

}

Missing User
 answered on 15 Aug 2008
2 answers
102 views
I'm using ClientIDs to position my tooltips.  The place where the tooltips are in the code leaves big blank areas the size of the tips (they are pretty large) on the page.

The tips do display in the right place, but I'm assuming they render wherever you place in the code and then are manually moved to their client location by JavaScript after load, thus leaving a big hole where they originally started.

Reason for using clientIDs is that my anchors are on the master page, but the page controlling the tips is a content page.

Any suggestions on how to either eliminate the big blank areas or tag a tooltip created on a content page to a target item on the master page?

FYI: Tried storing the tips in a hidden DIV, but they no longer worked.  (The big blank areas were gone, though...)

Thanks,

- Brad
Brad Docimo
Top achievements
Rank 1
 answered on 15 Aug 2008
7 answers
188 views
Hello,

Can the Resource/Timeline view of the RadScheduler can be extended further please? We'd like to have a Resource view where adjacent resources, attending the same event, has the event graphically shown only once as one large extended event, instead of one per resource (which is what is shown currently). The layout we are picturing has days with resources on the vertical and time on the horizontal


I believe this was broached in previous threads:
1). Horizontal layouts and time tooltip
2).
"Futures" Info: RadScheduler and RadChart

Thanks very much.

- Wen
Simon
Telerik team
 answered on 15 Aug 2008
2 answers
271 views
Hello,

I'm using a radTabStrip menu, not multipage and at times, very random, I receive a "null is null or not an object" error when I click on a tab. I could successfully click the tab prior or after receiving the error but at times the error appears.

Here is some code for the javascript. 

<

script type="text/javascript" language="javascript">

function SelectMyTab(sender, args)

{

//var multiPageID = sender.get_multiPageID();

//sender.set_multiPageID(null);

args.get_tab().select();

//sender.set_multiPageID(multiPageID);

}

function UnSelectMyTab(e)

{

var tabStrip = $find('<%= MainNav.ClientID%>');

//Find the element which the mouse is over

var destElement = e.relatedTarget || e.toElement;

if ($telerik.isDescendant(tabStrip.get_element(), destElement))

return;

var initialTab = tabStrip.findTabByText("<%= MyTab %>");

initialTab.unselect();

initialTab.selectParents();

}

</

script>

As you can see I removed the multipage references. I'm wondering if that has something to do with it.

Basically, I don't want multipage. I want the tab to load a new .aspx page when clicked, which is what is happening. I have onstates set, mouseover and mouseout states.

I need to remove this error and resolve the null reference.

In debug mode, when the error occurs it breaks here:

if

($telerik.isDescendant(tabStrip.get_element(), destElement))

My RadTabStrip looks like this:

 <telerik:RadTabStrip ID="MainNav" runat="server" SelectedIndex="0"
                                AutoPostBack="True" Skin="MainTheme" EnableEmbeddedSkins="false"
                                OnClientMouseOver="SelectMyTab" onmouseout="UnSelectMyTab(event)"
                                ClickSelectedTab="true" UnSelectChildren="true"
                                ontabcreated="MainNav_TabCreated">
                               <Tabs>
                                   <telerik:RadTab ID="TabHome" runat="server" Text="Home" NavigateUrl="~/Default.aspx" onmouseover="changeIt(0);" onclick="setMouseOut(0);">
                                       <Tabs>
                                           <telerik:RadTab ID="Tab1" runat="server" Text="Tab 1" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';"  NavigateUrl="~/Tab1.aspx" />
                                          
                                           <telerik:RadTab ID="TabSeparator1" runat="server" IsSeparator="true" Text="|" />
                                          
                                           <telerik:RadTab ID="Tab2" runat="server" Text="Tab 2" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';"  NavigateUrl="~/Tab2.aspx" />
                                       </Tabs>
                                   </telerik:RadTab>

                                   <telerik:RadTab ID="TabExtended" runat="server">
                                        <Tabs>
                                            <telerik:RadTab ID="TabExtendedPH" runat="server" />
                                        </Tabs>   
                                   </telerik:RadTab>

                               </Tabs>
                           </telerik:RadTabStrip>

Any help is much appreciated, thanks in advance for your time and consideration.

Remi
Top achievements
Rank 2
 answered on 15 Aug 2008
3 answers
169 views
Hi

Iam trying to bind a RadScheduler to a Linq datasource, i got everything working but all appointments after a specific date simply dont show up.

I tried debugging and the var q below here includes information about these appointment, however they show up in none of the RadSchedluer Views.


protected void RadScheduler1_DataBinding(object sender, EventArgs e)  
        {  
              
            FlexyNet.Data.FlexyBookLocalDataContext db = new FlexyNet.Data.FlexyBookLocalDataContext(Connections.CurrentCenterConnectionString);  
            var q = from v in db.vagtPlans  
                    orderby v.start  
                    where v.start < v.slut && v.personale_db.personale_custID == fUser.CustID && v.start >= RadScheduler1.VisibleRangeStart && v.slut <= RadScheduler1.VisibleRangeEnd  
                    select new { v.vagt_id, v.start, v.slut, kommentar = v.kommentar };  
            this.Label1.Text = q.ToString();  
            this.RadScheduler1.DataKeyField = "vagt_id";  
            this.RadScheduler1.DataEndField = "slut";  
            this.RadScheduler1.DataStartField = "start";  
            this.RadScheduler1.DataSubjectField = "kommentar";  
            this.RadScheduler1.DataSource= q;  
            this.RadScheduler1.Rebind();  
        } 

Does the RadScheduler it self only select the appointments within the visible range or do i have to do it as above to optimize speed ?
Simon
Telerik team
 answered on 15 Aug 2008
1 answer
165 views
Hi,

I have just spent around 3 hours trying to sort out the problem. The problem is very simple, I have a page which has got some textboxes, its a form basically. There is also a grid on the page and a button. When the button is clicked it opens another radwindow and shows some options to the user, at the end when user clicks submit, it does some processing and closes itself and reload the parent page. The problem is if I reload the parent page I lose every thing which has been entered in the textboxes etc. I have tried every example of closing and rebinding the grid but I can only make the parent page refresh which is not what I want. I am working in DNN by the way.

Also there is another problem, I am using multiview and load ascx control in multiview according to some session variable. The problem I am facing is that multiview loads the ascx control twice on the first load which ends up duplicating the databind with treeview I have on the ascx control. Can you please help with this as well.

Please write the full code in your answer..

Thanks
Atiq
Georgi Tunev
Telerik team
 answered on 15 Aug 2008
7 answers
276 views
I'd like to have an "alarm clock" style input.  I don't like the RadTimePicker all that much.   Basically if the RadNumericInput ShowSpinControls=true allowed me to say 00..09, 10, 11..59 I would be completely happy.

Anyone know how to get the RadNumericInput to have leading 0s for < 10?

Alternatively, the asp:listbox is what I need (00:00, 00:30, ... 23:30) which looks like a spinner, but the Telerik list control doesn't do that either, as I recall.

Thanks,
Tim

Dimo
Telerik team
 answered on 15 Aug 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?