Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
107 views
Hi,
Any support on this ?  or no solution ??

I am getting crash when the TargetFolder="~/MYFiles" doesn't exist.. I tried to see whether folder exist on button click
but the crash appears before button click.. below is the code.

Can u help me out, how to check wether targetfolder exist or not.

 <telerik:RadUpload ID="RadUpload1" runat="server"
        ControlObjectsVisibility="CheckBoxes, AddButton, DeleteSelectedButton"
        TargetFolder="~/MYFiles" onfileexists="RadUpload1_FileExists" OverwriteExistingFiles="false">
  </telerik:RadUpload>

<asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click"  />

C#
 protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (RadUpload1.UploadedFiles.Count > 0)
        {
            string filename = Path.GetFileName(RadUpload1.UploadedFiles[0].GetName());
            if (System.IO.Directory.Exists(Server.MapPath(RadUpload1.TargetFolder)))
            {
            }
            else
            {  
            }
        }
    }

Regards,
Akki
Dimitar Terziev
Telerik team
 answered on 21 Mar 2012
3 answers
106 views
I have spent the last few hours reading docs, threads and demos about the RadToolTipManager. I just don't get it. Here is what I want to do:

I have a ton of controls I need tool tips for. Right now the page has a separate RadToolTip for each control. I don't want this. But I can't figure out how to use the manager. How do I tell it what controls to use? These aren't dynamic controls, I know exactly what the list of controls is before the page runs so I don't need some wonky server code on some event running to fill the container at run-time. I can hard code them all in. So how do I do that exactly? Also, how do I tell it what tip text to give each control. Again, this is all static strings, I don't need to fetch text from a db and do ajax updates for every tool tip. How can I just hard code the tips in for each control?
Marin Bratanov
Telerik team
 answered on 21 Mar 2012
8 answers
123 views
I have some menus where the last letter of a label is pushed to the next line. It isn't every label, just certain ones on the end. I'm not really quite sure why it is happening or where to begin to fix it. The behavior only shows up in IE (shocker!). I've attached some screen shots so that you can see. Any suggestions would be helpful.
Peter
Telerik team
 answered on 21 Mar 2012
6 answers
70 views
HI All:

I have used a variation the Javascript code here to warn the user about moving to a new page if there is unsaved data on the current page.  The "set_cancel(true)" statement stops the grid from moving to another page.  However, the page number in the pager control advances to the new page (i.e., If I click the "next page" button but cancel the page, the grid stays on page one but the pager shows page 2).  Is there any way to block this behaviour (or failing that is there any way I can set the page number back to the original)?

Thanks for your help.

John
John
Top achievements
Rank 1
 answered on 21 Mar 2012
6 answers
136 views
Hi,

I am using  this grid  and want to allow user to edit few columns only say unitprice and instock. Is it possible? If yes then please help.

Thanks
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
3 answers
101 views
Hi, I am deciding whether to use the TreeViewCombobox method, as shown in the demos that come with telerik installation.

/TreeView/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx

I need to ensure that the selection of treeeview item is possible through the keyboard. so far i have try navigating the treeview in the demo page but have not been successfull.

To expand the dropdown and make the treeview visible i use ALT + Down arrow key. This works. But then i cannot set focus to the treeview no matter what i do. Can anyone please tell me whether it is possible or any key combinations.

Thanks.

Amar
Dimitar Terziev
Telerik team
 answered on 21 Mar 2012
1 answer
72 views
Hi,

mac os x lion doesn't display horizontal scrollbar and that causes the columns to appear unaligned with the headers! I put here the example of the radscheduler but that happens pretty much everywhere. Has anyone noticed this already? 


regards
Kate
Telerik team
 answered on 21 Mar 2012
1 answer
142 views
Hi

I'm trying to implement client side hierarchial RadGrids as described here: 
http://blogs.telerik.com/vladimirenchev/posts/08-09-09/how-to-telerik-radgrid-master-detail-client-side-data-binding-using-linq-to-sql-and-webservice.aspx 

This works great for 2 levels of hierarchy (RadGrid1 has a NestedView in which RadGrid2 is placed).
But as soon as I try to implement third level of hierarchy and add a RadGrid3 inside of NestedView of RadGrid2 I get dramatically worse performance - about 2 minutes to get page rendered (against 7 seconds for page with 2 levels). Page contains just pure markup, without any data bound. 

Please advise, what can be done in order to workaround this performance issue.

These are the test samples I've made:
First one is a quite fast 2 levels case (contains just a label inside of RadGrid2 NestedView), second is a slow one with RadGrid3 instead of label:

Label:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HierarchyTest-Label.aspx.cs" Inherits="HierarchyTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
<script type="text/javascript" language="javascript">
    RadGrid1_Command = function () {
        console.log('RadGrid1_Command');
    }
 
    RadGrid2_Command = function () {
        console.log('RadGrid2_Command');
    }
 
    RadGrid3_Command = function () {
        console.log('RadGrid3_Command');
    }
 
    RadGrid1_HierarchyExpanding = function (sender, args) {
        console.log('RadGrid1_HierarchyExpanding');
    }
 
    RadGrid2_HierarchyExpanding = function (sender, args) {
        console.log('RadGrid2_HierarchyExpanding');
    }
 
</script>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="False"
            GridLines="None" PageSize="10" Width="97%" Skin="Windows7">
            <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True"
                ReorderColumnsOnClient="True">
                <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true"
                    ClipCellContentOnResize="false"></Resizing>
                <ClientEvents OnCommand="RadGrid1_Command" OnHierarchyExpanding="RadGrid1_HierarchyExpanding" />
            </ClientSettings>
            <MasterTableView TableLayout="Fixed" AutoGenerateColumns="false" DataKeyNames="ServerId"
                ClientDataKeyNames="ServerId" HierarchyLoadMode="Client">
                <Columns>
                    <telerik:GridBoundColumn DataType="System.String" DataField="Server" HeaderText="Server"
                        UniqueName="Server" />
                    <telerik:GridBoundColumn DataType="System.String" DataField="Username" HeaderText="Username"
                        UniqueName="Username" />
                    <telerik:GridBoundColumn DataType="System.String" DataField="ServerId" UniqueName="ServerId"
                        Visible="false" />
                </Columns>
                <NestedViewTemplate>
                    <telerik:RadGrid runat="server" ID="RadGrid2" AllowPaging="False" AllowSorting="False"
                        GridLines="None" Width="97%" Skin="Windows7">
                        <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True"
                            ReorderColumnsOnClient="True">
                            <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true"
                                ClipCellContentOnResize="false"></Resizing>
                            <ClientEvents OnCommand="RadGrid2_Command" OnHierarchyExpanding="RadGrid2_HierarchyExpanding" />
                        </ClientSettings>
                        <MasterTableView TableLayout="Fixed" AutoGenerateColumns="false" ClientDataKeyNames="Id"
                            HierarchyLoadMode="Client">
                            <Columns>
                                <telerik:GridImageColumn DataType="System.String" HeaderText="St" DataImageUrlFormatString="Images\{0}.gif"
                                    DataImageUrlFields="Active" ImageWidth="16px" ImageHeight="16px" HeaderStyle-Width="26px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="JobName" UniqueName="JobName"
                                    HeaderText="Job Name" HeaderStyle-Width="170px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Description" UniqueName="Description"
                                    HeaderText="Description" HeaderStyle-Width="250px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Result" UniqueName="Result"
                                    HeaderText="Result" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="NextRunStr" UniqueName="NextRunStr"
                                    HeaderText="Next run" HeaderStyle-Width="120px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="DateCreatedStr" UniqueName="DateCreatedStr"
                                    HeaderText="Date created" HeaderStyle-Width="120px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Status" UniqueName="Status"
                                    HeaderText="Status" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Id" UniqueName="ID"
                                    Visible="false" />
                            </Columns>
                            <NestedViewTemplate>
                                <asp:Label runat="server" Text="Level 3" />
                            </NestedViewTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>   
    </div>
    </form>
</body>
</html>


RadGrid:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HierarchyTest-Label.aspx.cs" Inherits="HierarchyTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
<script type="text/javascript" language="javascript">
    RadGrid1_Command = function () {
        console.log('RadGrid1_Command');
    }
 
    RadGrid2_Command = function () {
        console.log('RadGrid2_Command');
    }
 
    RadGrid3_Command = function () {
        console.log('RadGrid3_Command');
    }
 
    RadGrid1_HierarchyExpanding = function (sender, args) {
        console.log('RadGrid1_HierarchyExpanding');
    }
 
    RadGrid2_HierarchyExpanding = function (sender, args) {
        console.log('RadGrid2_HierarchyExpanding');
    }
 
</script>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="False"
            GridLines="None" PageSize="10" Width="97%" Skin="Windows7">
            <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True"
                ReorderColumnsOnClient="True">
                <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true"
                    ClipCellContentOnResize="false"></Resizing>
                <ClientEvents OnCommand="RadGrid1_Command" OnHierarchyExpanding="RadGrid1_HierarchyExpanding" />
            </ClientSettings>
            <MasterTableView TableLayout="Fixed" AutoGenerateColumns="false" DataKeyNames="ServerId"
                ClientDataKeyNames="ServerId" HierarchyLoadMode="Client">
                <Columns>
                    <telerik:GridBoundColumn DataType="System.String" DataField="Server" HeaderText="Server"
                        UniqueName="Server" />
                    <telerik:GridBoundColumn DataType="System.String" DataField="Username" HeaderText="Username"
                        UniqueName="Username" />
                    <telerik:GridBoundColumn DataType="System.String" DataField="ServerId" UniqueName="ServerId"
                        Visible="false" />
                </Columns>
                <NestedViewTemplate>
                    <telerik:RadGrid runat="server" ID="RadGrid2" AllowPaging="False" AllowSorting="False"
                        GridLines="None" Width="97%" Skin="Windows7">
                        <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True"
                            ReorderColumnsOnClient="True">
                            <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true"
                                ClipCellContentOnResize="false"></Resizing>
                            <ClientEvents OnCommand="RadGrid2_Command" OnHierarchyExpanding="RadGrid2_HierarchyExpanding" />
                        </ClientSettings>
                        <MasterTableView TableLayout="Fixed" AutoGenerateColumns="false" ClientDataKeyNames="Id"
                            HierarchyLoadMode="Client">
                            <Columns>
                                <telerik:GridImageColumn DataType="System.String" HeaderText="St" DataImageUrlFormatString="Images\{0}.gif"
                                    DataImageUrlFields="Active" ImageWidth="16px" ImageHeight="16px" HeaderStyle-Width="26px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="JobName" UniqueName="JobName"
                                    HeaderText="Job Name" HeaderStyle-Width="170px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Description" UniqueName="Description"
                                    HeaderText="Description" HeaderStyle-Width="250px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Result" UniqueName="Result"
                                    HeaderText="Result" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="NextRunStr" UniqueName="NextRunStr"
                                    HeaderText="Next run" HeaderStyle-Width="120px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="DateCreatedStr" UniqueName="DateCreatedStr"
                                    HeaderText="Date created" HeaderStyle-Width="120px" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Status" UniqueName="Status"
                                    HeaderText="Status" />
                                <telerik:GridBoundColumn DataType="System.String" DataField="Id" UniqueName="ID"
                                    Visible="false" />
                            </Columns>
                            <NestedViewTemplate>
                                <telerik:RadGrid runat="server" ID="RadGrid3" AllowPaging="False" AllowSorting="False"
                                    GridLines="None">
                                    <ClientSettings AllowColumnHide="False" AllowRowHide="False" AllowColumnsReorder="False"
                                        ReorderColumnsOnClient="False">
                                        <ClientEvents OnCommand="RadGrid3_Command" />
                                    </ClientSettings>
                                    <MasterTableView TableLayout="Fixed" AutoGenerateColumns="false" DataKeyNames="TaskId">
                                        <Columns>
                                            <telerik:GridImageColumn DataType="System.String" HeaderText="St" DataImageUrlFormatString="Images\{0}.gif"
                                                DataImageUrlFields="Active" ImageWidth="16px" ImageHeight="16px" HeaderStyle-Width="26px" />
                                            <telerik:GridBoundColumn DataType="System.String" DataField="TaskName" UniqueName="TaskName"
                                                HeaderText="Task Name" HeaderStyle-Width="170px" />
                                            <telerik:GridBoundColumn DataType="System.String" DataField="TaskId" UniqueName="TaskId"
                                                HeaderStyle-Width="170px" Visible="False" />
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </NestedViewTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>   
    </div>
    </form>
</body>
</html>
Antonio Stoilkov
Telerik team
 answered on 21 Mar 2012
1 answer
144 views
Another developer also has the same requirement and his question is at: http://www.telerik.com/community/forums/aspnet-ajax/ajax/block-access-to-controls-in-the-page-on-ajax-postback.aspx. I wasn't sure whether adding a reply to his indicating my need to know the answer as well (since there's no way to "follow" or "subscribe" to a question unless you reply to it) or adding a new thread was appropriate. I chose to add a new thread.

Our Telerik version is 2012.1.215.40. I tried the following code, which I saw in a demo:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            var currentLoadingPanel = null;
            var currentUpdatedControl = null;
            var idOfControl;

            function RequestStart(sender, args) {
                currentLoadingPanel = $find("<%= AjaxLoadingPanel.ClientID %>");
                // The control clicked is inside a RadAjaxPanel.
                // <telerik:RadAjaxPanel ID="AssessmentFilterAjaxPanel" runat="server" height="66px"
                // width="186px" HorizontalAlign="NotSet" LoadingPanelID="AjaxLoadingPanel" style="margin-right: 0px">
                 // <asp:PlaceHolder ID="AssessmentLinksPlaceholder" runat="server" EnableViewState="true"></asp:PlaceHolder>
                 // </telerik:RadAjaxPanel>
                 // The hyperlinks are created dynamically (it's faceted search) and the IDs start with "Assessment"
                idOfControl = args.get_eventTarget();

                if (idOfControl.indexOf("Assessment") > -1) {
                    // This control is inside a  RadAjaxPanel
                    // <telerik:RadAjaxPanel ID="PortfolioAjaxPanel" runat="server" Width="720px" HorizontalAlign="NotSet"           
                    // LoadingPanelID="AjaxLoadingPanel">
                    currentUpdatedControl = "<%= AssessmentInstanceRepeater.ClientID %>"; //
                }

                //show the loading panel over the updated control
                currentLoadingPanel.show(currentUpdatedControl);
            }

            function ResponseEnd() {
                //hide the loading panel and clean up the global variables
                if (currentLoadingPanel != null) {
                    currentLoadingPanel.hide(currentUpdatedControl);
                    currentUpdatedControl = null;
                    currentLoadingPanel = null;
                }
            }
        </script>
    </telerik:RadCodeBlock>   

The code inside the RadCodeBlock is not executed. I also refer to jQuery version 1.7.1 and use it successfully with $.noConflict();. This is the order of the scripts included (just in case this is the problem):

In the BODY:
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script src="scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="scripts/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>  

[The RadCodeBlock goes here]

And right before closing the BODY:
    <script language="javascript" type="text/javascript">
        $.noConflict();

      jQuery(document).ready(function($) {
           // My code handling modal pop-ups, inline editing, hiding and showing content. This works correctly.
        });
    </script>

The RadAjaxManager has the following AjaxSetting:

            <telerik:AjaxSetting AjaxControlID="AssessmentLinksPlaceholder">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ClearAllLink" />
                    <telerik:AjaxUpdatedControl ControlID="AssessmentAppliedFilterPlaceholder" />
                    <telerik:AjaxUpdatedControl ControlID="AssessmentLinksPlaceholder" />
                    <telerik:AjaxUpdatedControl ControlID="StatusLinksPlaceholder" LoadingPanelID="AjaxLoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="AssessmentInstanceRepeater" LoadingPanelID="AjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>

AJAX execution works correctly. The only problem I have to solve is how to disable or to block or to show the loading panel the other panels.

A reply to our problem is appreciated.

Elsa
Antonio Stoilkov
Telerik team
 answered on 21 Mar 2012
2 answers
814 views
I have created the simplest form I can to test setting a RadTextBox using javascript.

aspx:
<head runat="server">
<title>Textbox Page Load Testing</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="SCRM">
</asp:ScriptManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"
EnableRoundedCorners="True" />
<div>
<telerik:RadTextBox ID="txtTest" runat="server" Skin="" TextMode="SingleLine">
</telerik:RadTextBox>
</div>
<telerik:RadCodeBlock runat="server" ID="RadScriptBlock1">
<script type="text/javascript">
function setVal(val) {
$find("<%=txtTest.ClientID %>").set_value(val);
}
</script>
</telerik:RadCodeBlock>
</form>
</body>
</html>

VB:
Partial Class Default4
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        ClientScript.RegisterStartupScript(Me.GetType(), "Pass", "setVal('TestValue');", True)
    End Sub
End Class

I get the following error:
Microsoft JScript runtime error: Unable to get value of the property 'set_value': object is null or undefined

Yes I have to do it on page load.
Yes I have to do this using javascript.

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 21 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?