Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
103 views
Hi!

Ive made some js functions that resizes the editor when the browser window is resized.

Everything works great until theres a postback. After the postback setSize throws an exception all the time.

The line casuing the exception is. (located in a scriptresource)
ln:5694  c.style.height="";  (c is null)


My code:
var bw_currenteditor;
//function to set editor variable called from editor.OnClientLoad
function contentTemplateEditorInit(editor) {
bw_currenteditor = editor;
}

//function to resize which is called from body.onresize
function ResizeTemplateEditor(editor) {

if (!editor || typeof editor.setSize != "function")
        return;
//Get new editor width and height
var h = Math.abs(BWgetContentControlPreviewWindowHeight() - 160);
var w = Math.abs(BWgetContentControlPreviewWindowWidth() - 40);
editor.setSize(w, h);
}

Dobromir
Telerik team
 answered on 18 Feb 2010
1 answer
132 views
I have a very simple project, a radcalendar which calls javascript code when a date clicked (the code only displays some info on a label).
the code works fine but when I open radwindow  from a button and close it, the calendar stops responding....

the window I open is declared and showed like this:

Dim newWindow As New Telerik.Web.UI.RadWindow()             
newWindow.ID = "RadWindow1"
newWindow.NavigateUrl = "users/askQuestion.aspx"
newWindow.Width = 800
newWindow.Height = 500              
newWindow.VisibleOnPageLoad = True          
form1.Controls.Add(newWindow)

everything in my simple project goes fine untill I open (RadWinow1), after closing it, my calendar dies.
any solution????????????
Georgi Tunev
Telerik team
 answered on 18 Feb 2010
2 answers
339 views
Hi all,

I'm trying to solve this problem where un-checking all child nodes should un-check the parent node using JavaScript.

My tree view is populated through Linq data source, with CheckBoxes property set to true. If any of the child nodes is checked, the parent node will be checked too, however, I can't solve the problem where un-checking all child nodes lead to un-checking the parent node.

I tried several solutions, yet, the best I got was un-checking any of the checked child nodes will un-check the parent node.

Appreciate your help and assistant.

Regards,
loai taha
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
245 views
I have a RadComboBox in a RadSlidingPane and a RadGrid in RadPane.  The RadGrid has a javascript method bound to the OnRowSelected ClientEvent and the AllowRowSelect Selecting setting is set to true.  By clicking on a row in the Grid then I open a rad window.  That part is not important, but I just wanted to point it out.  What is happening is when the RadSlidingPane is slid open "Expanded" over the RadGrid and I click on the RadComboBox somewhere between the text in the ComboBox and the drop down arrow it causes the OnRowSelected event of the grid to fire, thus opening my RadWindow.  I am trying to figure out how to either make the area between the text and the drop down arrow of the RadComboBox not "transparent" through to the grid, or disable the AllowRowSelect of the grid while the RadSlidingPane is open.  I have already tried to set a flag indicating that the SlidingPane is expanded and when the OnRowSelected method is called just not execute the code.  However, the ComboBox does not drop down.

<script language="javascript">  
 
            var timerSettingUser = true;  
 
            function GetTimer()  
            {  
                return $find('<%= tmrQueueList.ClientID %>');  
            }  
 
            function StartTimer()  
            {  
                if (timerSettingUser)  
                {  
                    var timer = GetTimer();  
                    timer.set_enabled(true);  
                    timer._startTimer();  
 
                    var btn = $get('<%= lbtnSetAutoRefresh.ClientID %>');  
                    btn.innerText = "Off";  
                }  
            }  
 
            function StopTimer()  
            {  
                var timer = GetTimer();  
                timerSettingUser = timer.get_enabled();  
 
                if (timerSettingUser)  
                {  
                    timer.set_enabled(false);  
                    timer._stopTimer();  
 
                    var btn = $get('<%= lbtnSetAutoRefresh.ClientID %>');  
                    btn.innerText = "On";  
                }  
            }  
 
            function DeselectAllRows()  
            {  
                var grid = $find("<%= rgQueueList.ClientID %>");  
                var masterTable = grid.get_masterTableView();  
                masterTable.deleteSelectedItems();  
            }  
 
            function QueueRowSelected(sender, args)  
            {  
                StopTimer();  
                var pkQueue = args.getDataKeyValue("pkQueue");  
                var title = args.getDataKeyValue("JobScheduleDescription");  
                var win = radopen("view_jobqueue.aspx?pkqueue=" + pkQueue, "rwViewQueueItem");  
                if (title != null)  
                    win.set_title(title);  
                win.setSize(700, 600);  
                win.center();  
            }  
 
            function WindowClosed(sender, args)  
            {  
                StartTimer();  
                DeselectAllRows();  
            }  
 
            function QueueItemCheckChanged(cb)  
            {  
                for (var i = 0; i < QueueItemCBIDs.length; i++)  
                {  
                    document.getElementById(QueueItemCBIDs[i]).checked = cb.checked;  
                }  
            }  
 
            function SplitterLoaded(splitter, arg)  
            {  
                var pane = splitter.getPaneById('<%= rpContent.ClientID %>');  
                var height = pane.getContentElement().scrollHeight;  
                splitter.set_height(height);  
                pane.set_height(height);  
            }  
 
        </script> 
<h1> 
        Queue Manager</h1> 
    <rad:RadSplitter ID="rsQueueManager" runat="server" Width="100%" OnClientLoaded="SplitterLoaded">  
        <rad:RadPane ID="rpSidebar" runat="server" Scrolling="None" Width="22px">  
            <rad:RadSlidingZone ID="rszSidebar" runat="server" Width="22px">  
                <rad:RadSlidingPane ID="rspSidebar" Title="Settings" runat="server" Width="300px">  
                    <rad:RadAjaxLoadingPanel ID="ralpSearchSettings" runat="server">  
                    </rad:RadAjaxLoadingPanel> 
                    <rad:RadAjaxPanel ID="rapSearchSettings" runat="server" LoadingPanelID="ralpSearchSettings">  
                        <asp:Panel ID="pnlSearchSettings" runat="server" DefaultButton="btnSearch">  
                            <h2> 
                                Search Settings:</h2> 
                            <table class="PropertyTable">  
                                <tr> 
                                    <td>Search For:</td> 
                                    <td> 
                                        <asp:TextBox ID="txtSearchFor" runat="server"></asp:TextBox></td>  
                                </tr> 
                                <tr> 
                                    <td>Search By:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbSearchBy" runat="server" Width="120px">  
                                            <Items> 
                                                <rad:RadComboBoxItem Text="Queue ID" Value="QueueID" Selected="true" /> 
                                                <rad:RadComboBoxItem Text="Job Name" Value="JobName" /> 
                                                <rad:RadComboBoxItem Text="Job Type" Value="JobType" /> 
                                                <rad:RadComboBoxItem Text="Schedule" Value="Schedule" /> 
                                                <rad:RadComboBoxItem Text="Worker" Value="Worker" /> 
                                                <rad:RadComboBoxItem Text="Result" Value="Result" /> 
                                            </Items> 
                                        </rad:RadComboBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Start Date:</td> 
                                    <td> 
                                        <rad:RadDateTimePicker ID="rdtpStartDate" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>End Date:</td> 
                                    <td> 
                                        <rad:RadDateTimePicker ID="rdtpEndDate" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Status:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbStatus" runat="server" Width="100px">  
                                            <Items> 
                                                <rad:RadComboBoxItem Text="All" Value="0" /> 
                                                <rad:RadComboBoxItem Text="Scheduled" Value="1" /> 
                                                <rad:RadComboBoxItem Text="Processing" Value="2" /> 
                                                <rad:RadComboBoxItem Text="Success" Value="3" /> 
                                                <rad:RadComboBoxItem Text="Failed" Value="4" /> 
                                                <rad:RadComboBoxItem Text="Rescheduled" Value="5" /> 
                                                <rad:RadComboBoxItem Text="Hold" Value="6" /> 
                                            </Items> 
                                        </rad:RadComboBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Processed By:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbProcessedBy" runat="server" Width="100px" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Job:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbJob" runat="server" AutoPostBack="true" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Schedule:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbJobSchedule" runat="server" AutoPostBack="true" /> 
                                    </td> 
                                </tr> 
                            </table> 
                            <asp:Button ID="btnSearch" runat="server" Text="Search" onclick="btnSearch_Click" /> 
                        </asp:Panel> 
                    </rad:RadAjaxPanel> 
                    <h2> 
                        Configure Jobs</h2> 
                    Change Status:  
                    <rad:RadComboBox ID="rcbUpdateStatus" runat="server" MarkFirstMatch="False" AllowCustomText="False" Width="110" Height="130" AutoPostBack="False" EnableLoadOnDemand="False" HighlightTemplatedItems="True">  
                        <Items> 
                            <rad:RadComboBoxItem Text="Hold" Value="6" /> 
                            <rad:RadComboBoxItem Text="Resume" Value="7" /> 
                            <rad:RadComboBoxItem Text="Delete" Value="8" /> 
                            <rad:RadComboBoxItem Text="Failed" Value="4" /> 
                            <rad:RadComboBoxItem Text="Rescheduled" Value="5" /> 
                            <rad:RadComboBoxItem Text="Run Now" Value="10" /> 
                        </Items> 
                    </rad:RadComboBox> 
                    <asp:Button ID="btnUpdateStatus" runat="server" Text="Update Status" onclick="btnUpdateStatus_Click" /> 
                </rad:RadSlidingPane> 
            </rad:RadSlidingZone> 
        </rad:RadPane> 
        <rad:RadPane ID="rpContent" runat="server">  
            <div style="padding: 5px">  
                <asp:Panel ID="pnlQueueManager" runat="server">  
                    <div style="background-color: #F4F4F4; border-top: solid 1px #E5E5E5; border-bottom: solid 1px #BBBBBB; border-right: solid 1px #BBBBBB; border-left: solid 1px #E5E5E5">  
                        <table cellpadding="0" cellspacing="0" width="100%">  
                            <tr> 
                                <td width="220">Change Status: </td> 
                                <td width="230">  
                                    <rad:RadToolBar ID="rtbQueueManager" runat="server" AutoPostBack="true" ImagesDir="~/Resources/Images">  
                                        <Items> 
                                            <rad:RadToolBarButton ID="rtbbUpdateStatus" CommandName="UpdateStatus" Text="Apply" ImageUrl="~/Resources/Images/apply.png" /> 
                                            <rad:RadToolBarButton ID="rtbbSearch" CommandName="Search" Text="Search / Refresh" ImageUrl="~/Resources/Images/search.png" /> 
                                        </Items> 
                                    </rad:RadToolBar> 
                                </td> 
                                <td align="right" style="padding-right: 5px" nowrap>Turn Auto Refresh:  
                                    <asp:LinkButton ID="lbtnSetAutoRefresh" runat="server">Off</asp:LinkButton></td>  
                            </tr> 
                        </table> 
                    </div> 
                </asp:Panel> 
                <br /> 
                <rad:RadAjaxLoadingPanel ID="ralpQueueList" runat="server" /> 
                <rad:RadAjaxPanel ID="rapQueueList" runat="server" LoadingPanelID="ralpQueueList">  
                    <asp:Timer ID="tmrQueueList" runat="server" Interval="60000" /> 
                    <rad:RadGrid ID="rgQueueList" runat="server" AutoGenerateColumns="False" AllowPaging="true" AllowSorting="true" OnItemDataBound="rgQueueList_ItemDataBound" OnNeedDataSource="rgQueueList_NeedDataSource" ShowGroupPanel="true">  
                        <MasterTableView DataKeyNames="pkQueue" ClientDataKeyNames="pkQueue, JobScheduleDescription" GroupLoadMode="Client">  
                            <Columns> 
                                <rad:GridTemplateColumn> 
                                    <ItemTemplate> 
                                        <asp:CheckBox ID="cbSelectQueueItem" runat="server" /> 
                                    </ItemTemplate> 
                                    <HeaderTemplate> 
                                        <asp:CheckBox ID="cbSelectQueueItem" runat="server" /> 
                                    </HeaderTemplate> 
                                </rad:GridTemplateColumn> 
                                <rad:GridBoundColumn DataField="pkQueue" HeaderText="ID" UniqueName="pkQueue" /> 
                                <rad:GridBoundColumn DataField="RunOn" HeaderText="Run On" UniqueName="RunOn" /> 
                                <rad:GridBoundColumn DataField="RunTime" HeaderText="Run Time" UniqueName="RunTime" /> 
                                <rad:GridBoundColumn DataField="JobName" HeaderText="Job" UniqueName="JobName" /> 
                                <rad:GridBoundColumn DataField="JobScheduleDescription" HeaderText="Schedule" UniqueName="JobScheduleDescription" /> 
                                <rad:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" /> 
                                <rad:GridBoundColumn DataField="NumberOfRetries" HeaderText="Retries" UniqueName="NumberOfRetries" /> 
                                <rad:GridBoundColumn DataField="ProcessedBy" HeaderText="Processed By" UniqueName="ProcessedBy" /> 
                                <rad:GridBoundColumn DataField="IsActive" HeaderText="Active" UniqueName="IsActive" /> 
                                <rad:GridTemplateColumn HeaderText="Dependent">  
                                    <ItemTemplate> 
                                        <%# ((int)Eval("fkParent") == 0) ? "No" : String.Format("On {0}", Eval("fkParent")) %> 
                                    </ItemTemplate> 
                                </rad:GridTemplateColumn> 
                            </Columns> 
                            <ItemStyle CssClass="ClickableRow GridRow_Default" /> 
                            <AlternatingItemStyle CssClass="ClickableRow GridRow_Default" /> 
                            <PagerStyle Mode="Slider" /> 
                        </MasterTableView> 
                        <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">  
                            <ClientEvents OnRowSelected="QueueRowSelected" /> 
                            <Selecting AllowRowSelect="true" /> 
                        </ClientSettings> 
                        <GroupingSettings ShowUnGroupButton="true" /> 
                    </rad:RadGrid> 
                    <div class="HorizontalButtonList">  
                        Errors per page:  
                        <rad:RadComboBox ID="rcbPageSize" runat="server" MarkFirstMatch="True" AllowCustomText="False" Width="60" Height="140" AutoPostBack="True" EnableLoadOnDemand="False" HighlightTemplatedItems="True" OnSelectedIndexChanged="rcbPageSize_SelectedIndexChanged">  
                            <Items> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem1" Text="10" Value="10" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem2" Text="15" Value="15" Selected="True" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem3" Text="20" Value="20" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem4" Text="25" Value="25" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem5" Text="30" Value="30" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem6" Text="50" Value="50" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem7" Text="100" Value="100" runat="server" /> 
                            </Items> 
                        </rad:RadComboBox> 
                    </div> 
                </rad:RadAjaxPanel> 
            </div> 
        </rad:RadPane> 
    </rad:RadSplitter> 
    <rad:RadWindowManager ID="rwmQueueManager" runat="server" DestroyOnClose="true" Modal="true" Style="z-index: 7001" OnClientClose="WindowClosed" /> 
    <rad:RadAjaxManager ID="ramMain" runat="server">  
    </rad:RadAjaxManager> 
T. Tsonev
Telerik team
 answered on 18 Feb 2010
1 answer
83 views
Hello - I am using RadControls for ASPNET AJAX Q2 2008.

After creating the App_GlobalResources folder for the website, I set forth
making a translated RadEditor.Tools.resx (RadEditor.Tools.nb-NO.resx).

This had the desired effekt of translating all the tooltips for every single tool,
but it had an unexpected side effect:

The dropdowns for font selection, font size, real font size and Paragraph style now
display my Norwegian tooltip-translations when the page is initially loaded:

"Font-navn", "Font-størrelse", "Ekte font-størrelse" and "Avsnittsstil".

So far, so good - but the moment I give focus to the editor - clicking on a tool or
in the text area, this happens:

FireFox 3.6 (Windows):
The dropdowns display "FontName", "Fontsize", "12px" and "Normal".
The first two dropdowns seem to change from displaying the norwegian translated
value of the nb-no.resx-file to displaying the corresponding names from the same file.
The last two dropdowns display the first item in their respective lists.

Internet Explorer 8:
The dropdowns display "Times New Roman", "3", "12pt" and "Normal".
Here all the dropdowns change to displaying the first item in their respective lists.

Safari 4.0.4 (Windows):
The dropdowns display "Times New Roman", "12px", "16px" and "FormatBlock".
A third variant.

Opera 10.00 (Windows):
The dropdowns display "Times New Roman", "3", "16px" and "Normal".
Yet another variant.

Why this erratic behaviour? Are there more .resx-files that need editing?
(I started out only intending to change the tool tips)

I hope can someone has a tip - it's probably just a minor adjustment that needs
to be done, but it's a tad annoying.





Rumen
Telerik team
 answered on 18 Feb 2010
1 answer
103 views
Hi

Can someone help here?..

Recently I have a strange error that I can't track down on a site that has been running for months.

I need to add a new page with a simple form with RadText boxes etc . I developed this on my
local development machine and it works fine, including the code behind form processing.

When it is published to the remote site I get a 404 error as if the page is not there, but I can
see that it is by logging in to the server (both page and code behind).

As part of the diagnosis I published a page with no controls on. Page is visible with no errors,
even though it uses an exisitng master page with Rad controls.

Then added a textbox in visual studio, and published that - get 404 error
and no other useful info.

The rest of the site with existing pages containing Rad controls is functioning normally.
I just can't seem to publish anything new with a Rad control on the page.

Help with diagnosing / fixing this greatly appreciated, as further devlopment has ground to a halt.

Thanks

Clive

P.S
local machine: VS 2008, windows vista, iis7, Rad Controls version 2009.2.826.35
Remote server is windows 2003, iis 6, same version of rad controls

Clive Hoggar
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
97 views
How can I use a GridClientSelectColumn with a radiobutton instead of a checkbox?
Shinu
Top achievements
Rank 2
 answered on 18 Feb 2010
1 answer
185 views
I am trying to capture the key pressed in a RadComboBox and determine if it is upper or lower case. I used the following code just to see what I was getting back:
function ddAgents_KeyPress(sender, eventArgs) {  
    var TextIn = eventArgs.get_domEvent().keyCode;  
    var stop=1;  
} 
I have this in there so I can put a stop on Stop=1 and mouse over and look at the value of TextIn. When I do this and run it, if I type a letter in, I will use the letter "g" as an example, the value of keyCode is the ascii value for the uppercase letter regardless of which is typed. So if I type in a "g", or a "G" either way the keyCode value is 71. what am I doing wrong? I have removed all styles though I have the Filter="StartsWith". Not sure if that could have anything to do with it or not, but if it does, I have no idea why. Any thoughts on why this is happening?

Here is my code where I setup the control just in case it helps:
<telerik:RadComboBox ID="ddAgents" Runat="server" Width="100px" AutoPostBack="true" OnSelectedIndexChanged="ddAgents_SelectedIndexChanged" Filter="StartsWith" OnClientKeyPressing="ddAgents_KeyPress">  
 




Veronica
Telerik team
 answered on 18 Feb 2010
1 answer
209 views
Hi Everyone,

I've got detail tables for my radgrid configured with the following hierarchy load modes:

MasterTableView - Server On Demand
  Detail Table View - Client
    Detail Table View - Not Specified (should be ServerOnDemand by default, right?)

All tables have ObjectDataSources declared for their DataSourceId.

Now, here's the funny behavior I'm seeing:
--If I expand a MasterTable row, the page posts back (per ServerOnDemand) and I see the first detail table.  Both nested detail tables are databound (due to client setting on the first nested detail table)
--If I expand another MasterTable row, the page posts back, and the first nested detail table is shown for each expanded row.  (in this case i'd see 2; one for the row expanded in step 1, and the one I just expanded
--if i expand the detail table view for the one in step 2, i see the 2nd nested table view.  the page doesn't postback, due to the client setting.  However, if i expand another master table row, the row with all levels expanded collapses down to only show the master table row.  If i only expand the master table row; the row doesn't collapse.

Weird, huh?  Any ideas on what could be going on here?
Pavlina
Telerik team
 answered on 18 Feb 2010
3 answers
110 views
I am trying to open a window from grid item to display additional info about the item.
To do that I need to pass the product name.

I am trying this, but at run time I get 'the tag is not well formed' .  

How can I do this correctly?

Thanks

Clive 

JAVASCRIPT  
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
    <script type="text/javascript" language="javascript">  
        function showWindow(url) {  
            var oWnd = $find("<%=RadWindow3.ClientID%>");  
            oWnd.setUrl(url);  
            oWnd.show();  
        }  
        function OnClientClose(oWnd) {  
            oWnd.setUrl("about:blank"); // Sets url to blank      
        }     
</script>   
    </telerik:RadCodeBlock> 
 
THE WINDOW  
 
<telerik:RadWindow ID="RadWindow3" runat="server"   
        Skin="Black" Behaviors="Move,Close,Resize" VisibleStatusbar="False"   
                    Animation="Fade"   
        IconUrl="~/images/favicon16.gif" Height="170px" Width="280px" 
                    OnClientClose="OnClientClose">  
                </telerik:RadWindow> 
 
 
THE GRID COLUMN  
 
<telerik:GridTemplateColumn DataField="Name"   
            HeaderText="Name" SortExpression="Name"   
            UniqueName="Name">  
            <EditItemTemplate> 
                <asp:TextBox ID="NameTextBox" runat="server"   
                    Text='<%# Bind("Name") %>'></asp:TextBox> 
            </EditItemTemplate> 
            <ItemTemplate> 
                <asp:HyperLink ID="HyperLink1" runat="server"   
                NavigateUrl="javascript:onclientclick=showWindow('../windows/en-primeur-tasting.aspx?Name=" & <%# Eval("Name") %> & "');"> 
                <%# Eval("Name") %> 
                </asp:HyperLink> 
                                
            </ItemTemplate> 
            <HeaderStyle Width="250px" /> 
        </telerik:GridTemplateColumn> 
Clive Hoggar
Top achievements
Rank 1
 answered on 18 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?