Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
Hi,

 I've a Master Page containing splitter with two panes.. Left pane is for menu and right pane is for content pages... I've set it to work when you update your content page and which is longer than usual then re set the height of the splitter so that we can see full page. The problem comes when validaition fires on the page,I've to show them in validation summary, at that time splitter size does not get changed and hence hiding bottom portion of the page.

I am attaching files for it. 

In SplitterDemo page... Selecting Check box will show hidden panel with long contents. This time splitter's size is changed. Which is desired.
But 
Problem 1. When un selecting check box - panel hides but spliiter's size is not changes. 
Problem 2. After selecting check box - click on button "Click Me' to fire validation. Now since validation summary gets displayed and bottom text boxes gets hidden.

P.S - I do not want to set scrolling = "Y" as this will brings up two scrolls and user gets confuse about it.

My Master Page:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.master.vb" Inherits="RadControlsWebApp.Site" %>
 
<!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>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/jquery-ui.min.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.map"></script>
    <link rel="Stylesheet" type="text/css" href="../App_Themes/Default/Application.css" />
    <asp:ContentPlaceHolder ID="cnthead" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadAjaxManager ID="ram" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadScriptManager ID="rsm" runat="server">
        <CompositeScript>
            <Scripts>
                 <asp:ScriptReference Path="~/Content/Scripts/Common.js" />
            </Scripts>
        </CompositeScript>
    </telerik:RadScriptManager>
    <telerik:RadScriptBlock ID="rtsb" runat="server">
        <script type="text/javascript">
 
            CheckSplitterSize = function () {
                var splitter = $find("<%= RadSplitter1.ClientID %>");
                var pane = splitter.getPaneById('<%= contentPane.ClientID %>');
                var height = pane.getContentElement().scrollHeight;
                splitter.set_height(height);
                pane.set_height(height);
            }
 
            SplitterLoaded = function (splitter, arg) {
                //alert('in SplitterLoaded ');
                var pane = splitter.getPaneById('<%= contentPane.ClientID %>');
                var height = pane.getContentElement().scrollHeight; splitter.set_height(height); pane.set_height(height);
            }
 
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function (sender, e) {
                $get("<%= appLoadingPanel.ClientID %>").style.height = document.documentElement.clientHeight + "px";
                var loadingImage = document.getElementById('<%= appLoadingPanel.FindControl("imgLoading").ClientID %>');
                $.showInCenter(loadingImage);
                if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
                    $get("<%= appLoadingPanel.ClientID %>").style.height = document.documentElement.scrollHeight + "px";
                }
            });
 
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadWindowManager ID="rwm" runat="server" Style="z-index: 21000" />
    <asp:ContentPlaceHolder ID="ScriptPlaceHolder" runat="server">
    </asp:ContentPlaceHolder>
    <table cellpadding="0" cellspacing="0" style="border-style: solid; width: 100%; background-color: White;">
        <tr>
            <td style="width: 100%;">
                <p>
                    This is header.
                </p>
            </td>
        </tr>
        <tr>
            <td style="width: 100%;">
                <asp:ContentPlaceHolder ID="cphTopPage" runat="server">
                </asp:ContentPlaceHolder>
            </td>
        </tr>
        <tr>
            <td style="width: 100%;">
                <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="400px"
                    SkinID="Sunset" OnClientLoaded="SplitterLoaded">
                    <telerik:RadPane ID="navigationPane" runat="server" Width="15%" MinWidth="100" Scrolling="None"
                        Height="100%">
                        <asp:Panel ID="pnlLeftTreeView" runat="server" Height="100%" CssClass="ScrollingMenu">
                            <telerik:RadPanelBar ID="pnlBarLeftNav" runat="server" Width="100%" ExpandMode="SingleExpandedItem"
                                Skin="Telerik">
                            </telerik:RadPanelBar>
                        </asp:Panel>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="RadSplitbar1" runat="server" Height="100%" CollapseMode="Forward">
                    </telerik:RadSplitBar>
                    <telerik:RadPane ID="contentPane" runat="server" Height="100%" Width="85%"
                        ShowContentDuringLoad="false"  Scrolling="None">
                        <table style="width: 100%;">
                            <tr>
                                <td>
                                    <asp:ValidationSummary ID="vsMain" runat="server" DisplayMode="BulletList" CssClass="ValidationSummary" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                </td>
                            </tr>
                            <tr>
                                <td align="right" valign="top">
                                    <asp:ContentPlaceHolder ID="cphRadButtons" runat="server">
                                    </asp:ContentPlaceHolder>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:ContentPlaceHolder ID="cphContent" runat="server">
                                    </asp:ContentPlaceHolder>
                                </td>
                            </tr>
                        </table>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </td>
        </tr>
        <tr>
            <td>
                <p>
                    This is site footer.
                </p>
            </td>
        </tr>
    </table>
    <telerik:RadAjaxLoadingPanel ID="appLoadingPanel" runat="server" IsSticky="true"
        Transparency="50" ClientIDMode="Static" BackgroundPosition="Center" CssClass="LoadingPanel"
        ZIndex="100000">
        <div style="height: 100%; width: 100%; background-color: #fff;">
            <asp:Image ID="imgLoading" runat="server" AlternateText="Loading" SkinID="sknLoading" />
        </div>
    </telerik:RadAjaxLoadingPanel>
    </form>
</body>
</html>

My Content Page (.aspx):

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="SplitterDemo.aspx.vb" Inherits="RadControlsWebApp.SplitterDemo" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="cnthead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
    <telerik:RadScriptBlock ID="scr" runat="server">
        <script type="text/javascript">
            OnRequestEnd = function (sender, arg) {
                CheckSplitterSize();
            }
        </script>
    </telerik:RadScriptBlock>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphTopPage" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphRadButtons" runat="server">
    <div>
        <telerik:RadAjaxPanel ID="rapContent" runat="server" LoadingPanelID="appLoadingPanel">
            <asp:Button ID="btnClickMe" runat="server" Text="Click Me" />
        </telerik:RadAjaxPanel>
    </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphContent" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="appLoadingPanel"
        ClientEvents-OnResponseEnd="OnRequestEnd">
        <asp:CheckBox ID="chkSelect" runat="server" Text="Show/Hide Panel" AutoPostBack="true" />
        <asp:Panel ID="pnlHiddenPanel" runat="server" Visible="false">
            <div style="height: 800px">
                This is very long text.
                <br />
                <asp:Label ID="lblSelect" runat="server" />
                <br />
                <asp:DropDownList ID="drpSelect" runat="server" AutoPostBack="true">
                    <asp:ListItem Text="C#" Value="C#" />
                    <asp:ListItem Text="Asp.Net" Value="Asp.Net" />
                    <asp:ListItem Text="SQL" Value="SQL" />
                    <asp:ListItem Text="Telerik" Value="Telerik" />
                </asp:DropDownList>
            </div>
        </asp:Panel>
        <br />
        Name:
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="req1" runat="server" ControlToValidate="txtName"
            ErrorMessage="Name required" Text="!" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        Last Name:
        <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLastName"
            ErrorMessage="Last Name required" Text="!" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        Age:
        <asp:TextBox ID="txtAge" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtAge"
            ErrorMessage="Age required" Text="!" ForeColor="Red"></asp:RequiredFieldValidator>
    </telerik:RadAjaxPanel>
</asp:Content>
Content Page Code Behind:
Public Class SplitterDemo
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Private Sub btnClickMe_Click(sender As Object, e As System.EventArgs) Handles btnClickMe.Click
 
    End Sub
 
    Private Sub chkSElect_CheckedChanged(sender As Object, e As System.EventArgs) Handles chkSelect.CheckedChanged
        ConsumeTime(2)
        pnlHiddenPanel.Visible = CBool(chkSelect.Checked)
    End Sub
 
    Private Sub ConsumeTime(ByVal seconds As Integer)
        Dim ticker As DateTime = DateTime.Now()
 
        While DateDiff(DateInterval.Second, ticker, DateTime.Now) <= seconds
 
        End While
    End Sub
 
    Private Sub drpSelect_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles drpSelect.SelectedIndexChanged
        lblSelect.Text = "You selected :" + drpSelect.SelectedValue
    End Sub
End Class
Common.js :
$.getRadWindow = function (win) {
    var oWindow = null;
    if (win.radWindow) oWindow = win.radWindow;
    else if (win.frameElement && win.frameElement.radWindow) oWindow = win.frameElement.radWindow;
    return oWindow;
}
 
 
$.showRadWindow = function (id) {
    var window = $find(id);
    if (window != null) {
        window.set_status("Ready");
        window.show();
        return true;
    }
    else
        return false;
}
 
 
$.showInCenter = function (ctrl) {
    posY = $.getScrollOffset() + ($.getInnerHeight() / 2) - (ctrl.height / 2);
    posX = document.documentElement.clientWidth / 2 - (ctrl.width / 2);
    $(ctrl).css({ position: "relative", top: posY + "px", left: posX + "px" });
}
 
$.getInnerHeight = function () {
    var y;
    if (self.innerHeight) // all except Explorer
        y = self.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight)
        y = document.documentElement.clientHeight;
    else if (document.body) // other Explorers
        y = document.body.clientHeight;
    return (y);
}
 
$.getScrollOffset = function () {
    var y;
    if (self.pageYOffset)
        y = self.pageYOffset;
    else if (document.documentElement && document.documentElement.scrollTop)
        y = document.documentElement.scrollTop;
    else if (document.body)
        y = document.body.scrollTop;
    return (y);
}
application.css :
body
{
    background-color: #C0C0C0;
    margin: 0;
    padding: 2px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-style: normal;
    line-height: 18px;
    color: #333333;
    font-weight: normal;
    font-size: 12px;
    height: auto;
}
 
a
{
    text-decoration: underline;
}
 
a:hover
{
    color: #d0981b;
}
 
.ValidationSummary
{
    border: 2px solid red;
    color: red;
    margin: 5px 0px;
    padding: 15px;
    background: #fff url(images/errors.png) no-repeat 5px 50%;
}
 
.ValidationSummary ul
{
    margin: 0;
    padding: 0;
    margin-left: 60px;
    list-style-type: square;
}
 
.InformationMessage
{
    border: 2px solid yellow;
    color: maroon;
    margin: 5px 0px;
    padding: 15px;
    background: #fff url(images/information.png) no-repeat 5px 50%;
}
 
.InformationMessage li
{
    margin: 0;
    padding: 0;
    margin-left: 60px;
    list-style-type: square;
}
 
.ScrollingDiv
{
    position: relative;
    border-color: #4682b4;
    border-style: solid;
    background-color: #FFFFCC;
}
 
.ScrollingMenu
{
    position: relative;
}
 
.LoadingPanel
{
    z-index: 100000;
    background-color: #ffffdd;
    border-color: Gray;
    position:absolute;
    height:100%;
    width:100%;
    top:0px;
    left:0px;
}
Image.skin:
<asp:Image SkinID="sknLoading" runat="server" ImageUrl="Images/Loading.gif" />
Attaching Loading.gif What i am missing?? How can i resolve both problems?
Tarang
Top achievements
Rank 1
 answered on 15 Jul 2013
3 answers
465 views
Hi telerik,

When I select files to upload, the files names are displayed above the control. I want to display the file names and internal progress bar below the file input.

Thanks for reply,
Needha.
Hristo Valyavicharski
Telerik team
 answered on 15 Jul 2013
0 answers
59 views
hello sir

 expand collapse header of Radgrid is invisible on Internet explorer but visible on firefox

below attached are screen shots of two different grids
please guide me to solve this problem

waiting for reply
Kishor
Top achievements
Rank 2
 asked on 15 Jul 2013
4 answers
596 views
Hello,

I got this error when I try to build my solution: 
Type 'Telerik.Web.UI.RadGrid' does not have a public property named 'BatchEditingSettings'.

Since BatchEditing is a new component, clearly my current dll does not support BatchEditingSettings. Which version should I download?

P.S.: I still have demo version. 
Hakan
Top achievements
Rank 1
 answered on 15 Jul 2013
3 answers
220 views
I'm using RadAsyncUpload to allow a file to be uploaded to the server.

However, we also have an anti-CSRF token on the page involved.  Is there some way that I can append a header or add to the request that AsyncUpload makes to enable this to be passed along?

Thanks.
Hristo Valyavicharski
Telerik team
 answered on 15 Jul 2013
2 answers
202 views
I have a RadAsyncUpload control that is declared dynamically on the server side.  It is working fine.  However, I would like to change the filename before it is saved.  I tried to set the OnFileUploaded property, but I get the message

'Telerik.Web.UI.RadAsyncUpload.OnFileUploaded (Telerik.Web.UI.FileUploadedEventArgs)' is inaccessible due to its protection level.

How do I set the OnFileUploaded property?  Alternatively, how else could I change the file name of the file before saving it to the sever?

Here is where I declare the RadAsyncUpload control:
RadAsyncUpload upload = new RadAsyncUpload();
upload.ID = "rauChoice";
upload.Attributes.Add("runat", "server");
upload.TargetFolder = "~/App_Images/uploads";
upload.TemporaryFolder = "~/App_Data/RadUploadTemp";
upload.OnFileUploaded = "rauChoice_FileUploaded";
Troy
Top achievements
Rank 1
 answered on 15 Jul 2013
5 answers
70 views
Greetings!

I'm having trouble with Social Share and a RadSocialButton where SocialNetType is "GooglePlusOne". It seems very easy to replicate.

When I use that button via the test below, the URL that it requests from Google for the FastButton script is:

https://apis.google.com/_/+1/fastbutton?bsv&size=470&annotation=470&width=&hl=en-US&origin=http%3A%2F%2Flocalhost%3A57814&url=http%3A%2F%2Fwww.telerik.com%2F&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.VvwHmr5PUZc.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTPwTaslh-up04HMsbjUbinCI6C0Hw

Google is returning an error 400 (access is denied) for that script url.

It seems that the problem with the URL is the "annotation=470" parameter. According to the Google API, annotation is an enumeration that should have a value such as "none" or "inline". "470" seems invalid and I suspect is causing the problem. Is it mistakenly being copied over from size?

Is this a known issue? Am I doing something wrong or is there a workaround?

To confirm, the URL:

https://apis.google.com/_/+1/fastbutton?bsv&size=470&width=&hl=en-US&origin=http%3A%2F%2Flocalhost%3A57814&url=http%3A%2F%2Fwww.telerik.com%2F&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.VvwHmr5PUZc.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTPwTaslh-up04HMsbjUbinCI6C0Hw

...works fine (which is the same URL, without the annotation parameter).

I am using 2013.2.611.40

The code to reproduce this is simply:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="GooglePlusTest._default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server" />
        <telerik:RadSocialShare ID="RadSocialShare1" runat="server" UrlToShare="http://www.telerik.com" >
            <MainButtons>
                <telerik:RadSocialButton SocialNetType="ShareOnFacebook" />
                <telerik:RadSocialButton SocialNetType="GooglePlusOne" />
                <telerik:RadSocialButton SocialNetType="ShareOnTwitter" />
            </MainButtons>
        </telerik:RadSocialShare>
    </div>
    </form>
</body>
</html>
Danail Vasilev
Telerik team
 answered on 15 Jul 2013
1 answer
152 views
hi everybody
i need to run this server code in client side.
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem data = (GridDataItem)e.Item;
        if (e.CommandName == "Command1")
        {
            data["OrderID"].Text = "300";
        }
        else if (e.CommandName == "Command2")
        {
            data["OrderID"].Text = "600";
        }
    }
}
can anybody help me to convert this code to java script?
Andrey
Telerik team
 answered on 15 Jul 2013
3 answers
939 views
Hi,

   Is it possible to display the RadAjaxLoadingPanel over a RadAjaxPanel (or ASP Panel) using javascript even if you won't have any server event?
   Say, I have several user controls that I load within RadTabStrip. Each user control has their own javascript function that kicks a webservice call. What I want to accomplish is, the moment the javascript initiates the webservice call until the webservice returns a result, I want to display the RadAjaxPanel so the user will know that the transaction is being executed. At the same time, they won't be able to click on anything inside the tab until the webservice returns and prompt that the transaction was successfully completed. Is the use of RadAjaxLoadingPanel possible fo this scenario? Or is there any work around that we can do for this?

Thanks in advance!


Regards,
Arthur
Maria Ilieva
Telerik team
 answered on 15 Jul 2013
1 answer
129 views
Hello,

As you can see in the demo:
http://demos.telerik.com/aspnet-ajax/treelist/examples/client/resizing/defaultcs.aspx

When you size one column, the other columns are also adjusted... Even when I state a fixed width (40px ie) and state that the column is not sizeable, and state the min and max size at 40px, it still gets sized when i size an other column... how can I make a column stay 40px??

Erik
Deyan Enchev
Telerik team
 answered on 15 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?