Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
54 views
I'm using the Advanced Form.  No problems with it.  Everything works fine.  Except...when the form comes up, only the controls and text load, and the form itself is actually clear (you can't see it).  What could I be doing wrong?  I can even click and drag the form around.  Please see attached screenshot.

It was actually working fine earlier.  The first time I saw this was when I uploaded it to the production server.  And then after I upgraded the project to the latest version, it started doing it locally too.
Adrian Barnes
Top achievements
Rank 1
 answered on 21 Jan 2011
6 answers
210 views
Hi,

I'm messing around with creating a dock page which has several selectable controls which you can add to a single dock. I got this working fine with session objects, but am struggling trying to move it to use cookies. Could you help?

The problem seems to be that it looses the controls from the dock after the postback. In the example I was using with sessions, there was some code in the page_load which recreated the docks, I'm not really sure how to do this from the information that is stored in the cookie. Should I be looking at serializing the dockstate dictionary, or recreating the docks from the cookie information? Heres the code I've got:

Thanks for any suggestions,
Lee.

It also uses a master page and a web user control, but these have nothing in them except some html to test with.

ASPX:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %>

<%@ Register src="WebUserControl.ascx" tagname="SampleWidget" tagprefix="uc1" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
            onsavedocklayout="RadDockLayout1_SaveDockLayout"
            onloaddocklayout="RadDockLayout1_LoadDockLayout" EnableEmbeddedSkins="False"
            EnableViewState="true" StoreLayoutInViewState="false">
               
           
            <telerik:RadDockZone ID="RadDockZone1" Runat="server" MinHeight="300px" Width="99%"
            style="float:left;" Orientation="Horizontal">
           
           
            </telerik:RadDockZone>
           
            <div style="display:none">
                Hidden UpdatePanel, which is used to receive the new dock controls.
                <asp:updatepanel runat="server" id="UpdatePanel1">
                </asp:updatepanel>
            </div>
           
        </telerik:RadDockLayout>
    </div>

    <div style="clear:both;"></div>
   
    <div>
       
        <asp:CheckBoxList runat="server" ID="checkboxlist">
            <asp:ListItem Value="~/WebUserControl.ascx|300" Enabled="true">Sample1</asp:ListItem>
            <asp:ListItem Value="~/WebUserControl.ascx|300" Enabled="true">Sample2</asp:ListItem>
            <asp:ListItem Value="~/WebUserControl.ascx|450" Enabled="true">Sample3</asp:ListItem>
        </asp:CheckBoxList>
       
       
        <asp:Button runat="server" ID="Button1" Text="Add Selected" OnClick="AddSelected_Click" />
    </div>

</asp:Content>

.CS:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Linq;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Script.Serialization;
using System.Collections.Generic;
using System.Text;

using Telerik.Web.UI;

public partial class Default2 : System.Web.UI.Page
{
    private const string cookiename = "__example_website";

    protected void Page_Load()
    {

    }

    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
    {
        HttpCookie positionsCookie = Request.Cookies[cookiename];
        if (!Object.Equals(positionsCookie, null))
        {
            string serializedPositionsAndIndices = positionsCookie.Value;
            if (!string.IsNullOrEmpty(serializedPositionsAndIndices))
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string[] positionsAndIndices = serializer.Deserialize<string[]>(serializedPositionsAndIndices);
                e.Positions = serializer.Deserialize<Dictionary<string, string>>(positionsAndIndices[0]);
                e.Indices = serializer.Deserialize<Dictionary<string, int>>(positionsAndIndices[1]);
            }
        }
    }

    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
    {
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        string serializedPositions = serializer.Serialize(e.Positions);
        string serializedIndices = serializer.Serialize(e.Indices);

        HttpCookie positionsCookie = new HttpCookie(cookiename,
            serializer.Serialize(new string[] { serializedPositions, serializedIndices }));

        //Ensure that the cookie will not expire soon
        positionsCookie.Expires = DateTime.Now.AddYears(1);
        Response.Cookies.Add(positionsCookie);

    }

    private RadDock CreateRadDock(string controlpath, string title, int width)
    {
        RadDock dock = new RadDock();
        dock.UniqueName = Guid.NewGuid().ToString();
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);
        dock.Title = title;
        Control control = LoadControl(controlpath);

        dock.ContentContainer.Controls.Add(control);
        dock.Width = Unit.Pixel(width);
        dock.DockMode = DockMode.Docked;

        dock.Commands.Add(new DockCloseCommand());
        dock.Commands.Add(new DockExpandCollapseCommand());
        dock.Command += new DockCommandEventHandler(dock_Command);

        return dock;
    }
    void dock_Command(object sender, DockCommandEventArgs e)
    {
        if (e.Command.Name == "Close")
        {
            ScriptManager.RegisterStartupScript(
            UpdatePanel1,
            this.GetType(),
            "RemoveDock",
            string.Format(@"function _removeDock() {{
                    Sys.Application.remove_load(_removeDock);
                    $find('{0}').undock();
                    $get('{1}').appendChild($get('{0}'));
                    $find('{0}').doPostBack('DockPositionChanged');
                    }};
                    Sys.Application.add_load(_removeDock);", ((RadDock)sender).ClientID, UpdatePanel1.ClientID),
                    true);
        }
    }
    private void CreateSaveStateTrigger(RadDock dock)
    {
        //Ensure that the RadDock control will initiate postback
        // when its position changes on the client or any of the commands is clicked.
        //Using the trigger we will "ajaxify" that postback.
        dock.AutoPostBack = true;
        dock.CommandsAutoPostBack = true;

        AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();
        saveStateTrigger.ControlID = dock.ID;
        saveStateTrigger.EventName = "DockPositionChanged";
        UpdatePanel1.Triggers.Add(saveStateTrigger);

        saveStateTrigger = new AsyncPostBackTrigger();
        saveStateTrigger.ControlID = dock.ID;
        saveStateTrigger.EventName = "Command";
        UpdatePanel1.Triggers.Add(saveStateTrigger);
    }

    protected void AddSelected_Click(Object sender, EventArgs e)
    {
        List<RadDock> add_docks = new List<RadDock>();
        List<RadDock> remove_docks = new List<RadDock>();

        foreach (ListItem li in checkboxlist.Items)
        {
            bool exists = RadDockZone1.Docks.Where(d => d.Title == li.Text).Count() > 0;
            if (li.Selected)
            {
                if (!exists)
                {
                    string[] values = li.Value.Split('|');
                    RadDock dock = CreateRadDock(values[0], li.Text, Int32.Parse(values[1]));

                    UpdatePanel1.ContentTemplateContainer.Controls.Add(dock);

                    add_docks.Add(dock);

                    CreateSaveStateTrigger(dock);
                }
            }
            else
            {
                if (exists)
                {
                    RadDock dock = RadDockZone1.Docks.FirstOrDefault(cds => cds.Title == li.Text);
                    remove_docks.Add(dock);
                }
            }
        }

        if (add_docks.Count > 0)
        {
            StringBuilder script = new StringBuilder();
            script.Append(@"function _addDock() {{");
            script.AppendLine();
            script.Append(@"Sys.Application.remove_load(_addDock); ");
            script.AppendLine();

            foreach (RadDock d in add_docks)
            {
                script.AppendFormat(@"$find('{0}').dock($find('{1}'));", RadDockZone1.ClientID, d.ClientID);
                script.AppendLine();
            }

            script.AppendFormat(@"$find('{0}').doPostBack('DockPositionChanged');", add_docks[0].ClientID);
            script.AppendLine();
            script.Append(@"}};");
            script.AppendLine();
            script.Append(@"Sys.Application.add_load(_addDock);");
            script.AppendLine();

            ScriptManager.RegisterStartupScript(
                this,
                this.GetType(),
                "AddDocks",
                script.ToString(),
                true);
        }
        if (remove_docks.Count > 0)
        {
            StringBuilder r_script = new StringBuilder();

            r_script.AppendLine(@"function _removeDock() {{");
            r_script.AppendLine("Sys.Application.remove_load(_removeDock);");

            foreach (RadDock d in remove_docks)
            {
                r_script.AppendFormat(@"$find('{0}').undock();", d.ClientID);
                r_script.AppendLine();
                r_script.AppendFormat(@"$get('{1}').appendChild($get('{0}'));", d.ClientID, UpdatePanel1.ClientID);
                r_script.AppendLine();

                // Close the raddock - to hide it in the updatepanel
                d.Closed = true;
            }

            r_script.AppendFormat(@"$find('{0}').doPostBack('DockPositionChanged');", remove_docks[0].ClientID);
            r_script.AppendLine();
            r_script.AppendLine(@"}};");
            r_script.AppendLine(@"Sys.Application.add_load(_removeDock);");

            ScriptManager.RegisterStartupScript(
                this,
                this.GetType(),
                "RemoveDocks",
                r_script.ToString(),
                true);
        }
    }
}

Pero
Telerik team
 answered on 21 Jan 2011
1 answer
170 views
Hi,

I have upgraded the RadEditor to the latest Telerik.Web.UI version and used the ToolsFile.xml to generate the toolbuttons.
The button IncreaseSize,DecreaseSize,ToggleDocking,RepeatLastCommand onclick give the message that it is not implemented.

Please suggest how to solve this.

Thanks In Advance.
Rumen
Telerik team
 answered on 21 Jan 2011
1 answer
462 views
I have one file server 2008 r2 and IIS 6.1 on it. I am trying to create a file server manager system using the file explorer control.

First thing that my web application is on the folder wwwroot/fileservermanager/ and 
I created a virtual directory under wwwroot/fileservermanager/ as wwwroot/fileservermanager/depo01/ 

/depo01/   is the D:/ of my physical drive and 

I am impersonating users as many ways and successfull 

<system.web>   
    <authentication mode="Windows"/>
        <identity impersonate="true"/>
<system.web/>

After publishing the web page I can impersonate the users and access the specific folders by file explorer and can perform upload, delete, create new folder operations but when i try Open the files I get the error 

Server Error in '/depo01' Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to 'D:\teknik_as\web.config' because access is denied.

Source Error: 

[No relevant source lines]

Source File: D:\teknik_as\web.config    Line: 



I dont have a web.config file under D:\teknik_as\   because this is the File Server folder that I m trying to open the files 

Is there a way to show a virtual directory as a folder under the project folders without any problems ?

web.config file
<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <appSettings>
        <add key="Telerik.Skin" value="Windows7"/>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled"/>
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled"/>
    </appSettings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
        <pages>
            <controls>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
            </controls>
        </pages>
        <httpHandlers>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
        <httpRuntime maxRequestLength="102400" executionTimeout="3600"/>
        <authentication mode="Windows">
        </authentication>
    <identity impersonate="true"/>
    </system.web>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
    <location path="FileExpl">
        <system.web>
            <authorization>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadUploadModule"/>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
            <remove name="RadCompression"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/>
        </modules>
        <handlers>
            <remove name="ChartImage_axd"/>
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_RadUploadProgressHandler_ashx"/>
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_WebResource_axd"/>
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
        </handlers>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="104857600"/>
            </requestFiltering>
        </security>
    </system.webServer>
    <system.serviceModel>
        <bindings />
        <client />
    </system.serviceModel>
</configuration>


file explorer viewpaths 

RadFileExplorer1.InitialPath = Page.ResolveUrl("~/depo01/TEKNIK_AS/");
 
String paths = Page.ResolveUrl("~/depo01/TEKNIK_AS/");
 
RadFileExplorer1.Configuration.ViewPaths = new String[] { paths };
RadFileExplorer1.Configuration.DeletePaths = new String[] { paths };
RadFileExplorer1.Configuration.UploadPaths = new String[] { paths };
  
/depo01/ is the virtual path, and I need help pls!
Chief
Top achievements
Rank 1
 answered on 21 Jan 2011
1 answer
117 views
hi

I have a sqldatasource that select * from tableA which has about 1000 rows. I bind the datasource to the grid. I enabled paging with default page size and indeed it show the page number. But when i allow custom paging, i don't see any page number. What have i done wrong? Thanks
Radoslav
Telerik team
 answered on 21 Jan 2011
1 answer
331 views

Hi Currently I working on Telerik grid control to fit my requirements.

I am using proper

 

<

 

GroupByExpressions>
    <telerik:GridGroupByExpression>
        <SelectFields>
            <telerik:GridGroupByField FieldName="MonthName" HeaderText=" " />
            <telerik:GridGroupByField FieldName="Year" HeaderText=" " />
        </SelectFields>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="MonthName" HeaderText=" " />
            <telerik:GridGroupByField FieldName="Year" HeaderText=" " />
        </GroupByFields>
    </telerik:GridGroupByExpression>

after implementation,  group headers are showing as e.g.  :December; : 2010

I want to format this text and remove ':' and ';' and replacewith some other special characters.

Please help me out.

 

Radoslav
Telerik team
 answered on 21 Jan 2011
2 answers
115 views
Hello

I have a grid that when i click on a item to edit it I try get the datakeyvalue from that item but it always just gets the first item on the list.

So i had a look in the grid.Items and found out that if i have data eg.
column1    column2
1             test1
2   test2
3   test3
4   test4

in my grid and i click on my edit button on the test3 row or whichever row then go look in the grid.items

It will change the item to the first item eg
In the grid.Items
Index    DataKeyValue
1           1
2           2
3           1(my row i click on)
4           4

Anyone ever had this any suggestions
 thanks
JedF
Top achievements
Rank 1
 answered on 21 Jan 2011
3 answers
136 views
I am using SSRS Report Viewer Control (VS2008) within a RADAJAXPanel. Parameters to the report are passed from controls within the same RADAJAXPanel. If a parameter value is changed, all text content within the report refreshes but not the charts when AJAX is enabled. The updated charts are visible if AJAX is disabled or after a manual IE page refresh.

This issue only occurs in IE7 and IE8. AJAX refresh in IE6 works fine.
Maria Ilieva
Telerik team
 answered on 21 Jan 2011
3 answers
49 views
http://www.telerik.com/help/aspnet-ajax/setting-additional-properties-to-the-node-in-the-web-service.html

According to the above link you can use a CustomRadTreeNodeDate class to send data to the client.  This all works great.  I'm looking for a way to post that information back to the webservice.  I can store the information in a node attribute, but I was wondering if there was a way to just "bind" it directly to the CustomRadTreeNodeData.  For example

public CustomRadTreeNodeData[] GetNodesWithToolTips(CustomRadTreeNodeData node, IDictionary context) {<br>}


When I POST information back to the webservice is there a way so I can access node.Tooltip?  I see ToolTip get sent to the client in the json response, but it never gets posted back??

POST:
{"node":{"Text":"node 1","Value":null,"ExpandMode":3,"NavigateUrl":null,"PostBack":true,"DisabledCssClass":null,"SelectedCssClass":null,"HoveredCssClass":null,"ImageUrl":null,"HoveredImageUrl":null,"DisabledImageUrl":null,"ExpandedImageUrl":null,"ContextMenuID":"","context":{}}
RESPONSE:
{"__type":"radtreeLoadOnDemand.CustomRadTreeNodeData","Text":"node 1","Value":"","ExpandMode":3,"NavigateUrl":"","PostBack":true,"DisabledCssClass":"","SelectedCssClass":"","HoveredCssClass":"","ImageUrl":"","HoveredImageUrl":null,"DisabledImageUrl":"","ExpandedImageUrl":"","ContextMenuID":null,"ToolTip":"My ToolTip","CssClass":"","ContentCssClass":null,"Enabled":true}
Nikolay Tsenkov
Telerik team
 answered on 21 Jan 2011
1 answer
51 views
Hello!

Today I took a "deep" look into the javascript methods, expandos, etc. of the radgrid control. There I found different methods, that are very interesting to me (in grouping and navigation with keys scenario ==> excel-like style), for example

var radGrid = $find(radGridId).get_masterTableView()._getNextDataRow()

I can see, that this methods needs a argument "a" (see attached png-File), but I don't know what type of argument and where I should get it then. Can anyone help me?

Generally: Is there a documentation of all these telerik-javascript-things, where this is all explained (I'm not an javascript expert)? Is there a pattern for the arguments, because as you can see in the picture, there are many methods, which need different arguments (b, f, etc.)?

Please help me.

Bye

Michael
Marin
Telerik team
 answered on 21 Jan 2011
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?