Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
149 views
I'm trying to track down some issues with invalid viewstate errors on my site. It is already the case that the site is using a specific machine key in the config file. One item noted on this post (http://bytes.com/topic/asp-net/answers/861764-invalid-viewstate-system-string-decryptstringwithiv) is that some of the script blocks are not wrapped in CDATA. In looking at the source for my site, I too notice that none of my blocks are wrapped in CDATA blocks which surprised me given that they are all wrapped in RadCodeBlocks.

Is it the case that RadCodeBlocks do not automatically wrap their contents in CDATA blocks when the DOCTYPE is set to XHTML? Is there a setting on the RadCodeBlocks to have it do so?
Dimo
Telerik team
 answered on 18 Sep 2009
3 answers
107 views

Hi,

Iam able to create a summary of appointments in the month view by following thesuggestions in this thread

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/customize-event-template-in-month-view.aspx

Iwould like this to happen only in the month view. How to stop it from happeningin the other views?

Thanks

Sabrish

Peter
Telerik team
 answered on 18 Sep 2009
1 answer
104 views
Hi ,

I am trying to (not successfully) To format various cells of the 2 DetailTables in my grid, when exporting to PDF  (using Vers 9.1).

a)  the formatting is not showing (though the code beneath does get entered, execute)
b) stepping thru , shows all cells to have   in them...so checking for 

if (item.Cells[j].Text == "Policy Information")

 

{

....Apply some formatting...
}
    never actually meets the condition and executes.

eg. my  Code from  the "ItemCreated" Event

if

 

( e.Item.OwnerTableView.Name == "ClientSchedDetl" )

 

{

 

if (e.Item is GridDataItem)

 

{

 

int j = 0;

 

 

GridDataItem item = e.Item as GridDataItem;

 

 

foreach (TableCell cell in item.Cells)

 

{

 

 

if (item != null)

 

{

 

 

if (item.Cells[j].Text == "Policy Information")

 

{

item[

"Policy Information"].Style["height"] = "20px";

 

 

//item["EnglishName"].Style["font-weight"] = "bolder";

 

 

//item["Description"].Style["font-size"] = "10px";

 

 

//item["OriginalName"].Style["font-family"] = "Arial Unicode MS";

 

 

//item["OriginalName"].Style["color"] = "#bbbbbb";

 

 

//item["Description"].Style["text-align"] = "center";

 

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "16px";

 

cell.Style[

"height"] = "24px";

 

cell.Style[

"font-weight"] = "bold";

 

}

 

else

 

{

 

if (j == 0)  //Column One  (no DataKey entries so 0 is the first visble column) MAKE BOLD

 

{

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "13px";

 

cell.Style[

"height"] = "24px";

 

cell.Style[

"font-weight"] = "bold";

 

}

 

else //Columns two and on..Non-Bold

 

{

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "10px";

 

cell.Style[

"height"] = "24px";

 

 

//cell.Style["font-weight"] = "normal";

 

}

}

j += 1;

}

}

thanks
Neal

Daniel
Telerik team
 answered on 18 Sep 2009
1 answer
282 views
Hi,

I'm having an issue where I have an ajaxified RadGrid and RadAjaxLoadingPanel panel defined.

The RadAjaxLoadingPanel  shows up fine in most cases but I can't get it to show up
when I change the pageSize of my RadGrid and have no idea how to refernce the pageSize
dropdown itself to get it to show the panel. Could anyone help with this issue? Thanks!
Mira
Telerik team
 answered on 18 Sep 2009
1 answer
133 views
Hi. How can I get a reference to a RadEditor in a

RadPageView? I tried

 

$find("<%=RadEditor1.ClientID%>"); but it returs null. Is it because its in a

 

RadPageView which is inside a RadMultiPage, which is inside a RadPane, which is inside a RadSplitter, etc?

I have a reference to the RadPageView that the RadEditor is in obtained with  multiPage.get_pageViews().getPageView(x)

Thanks,
Brian

 

Tervel
Telerik team
 answered on 18 Sep 2009
0 answers
71 views
How can i click the weekview header to  change to the  dayview
for example the  weekview  header is  monday,19,   click ,monday,19,
change to dayview and the dayview select day is  19.
Thanks!
h
Top achievements
Rank 1
 asked on 18 Sep 2009
1 answer
61 views
Hi!

In my page I have a couple of comboboxes, a grid and a button. The structure of the grid is a three-level hierarchy: Properties -> Buildings -> Objects. The datasource of the grid is specified from choices the user has made from the comboboxes. Its not an option to load all items clientside because when an item is expanded i need to run some checks and maybe modify the items. When the button is clicked the LoadGrid method fires and loads the grid with the correct datasources, one datasource for every level in the hierarchy. Because of the grid loading in the buttonclick-event the datasource disappears for example when i try expanding an item.
How can I persist the datasource of the grid?

I have tried to load the grid in the Page_Init event, as in the example http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html,  which works fine but then i will not be able to filter the datasource from the comboboxes.

The structure of the grid is created as in the example above with the only difference that the method fires in the ButtonClick event instead of the Page_Init event.

Regards, Johannes


Mira
Telerik team
 answered on 18 Sep 2009
1 answer
156 views
Problem Overview:
We are utilizing the RadDock controls to provide some dashboard/portal like functionality in our web site.  Users are allowed to add RadDocks to the page dynamically.  We have closely followed the example given at this website: http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx  Essentially, the issue seems to appear when we are utizing AJAX to automatically post back for all dockposition changes.  I have seen several types of these questions raised via google/telrik searches, but none specifically identical to my situation.  So, I have created a sample project which is a whittled down, simplified version of our real application which demonstrates the issue.

The most prominent javascript error seems to be:
Webpage error details 
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDR; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) 
Timestamp: Wed, 16 Sep 2009 21:39:37 UTC 
 
 
Message: 'undefined' is null or not an object 
Line: 5033 
Char: 2 
Code: 0 
URI: http://as-qa-vm/AIMSNET/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scriptManager_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2009.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad2d891f5-3533-469c-b9a2-ac7d16eb23ff%3a874f8ea2%3a24ee1bba%3a19620875%3a33108d14%3abd8f85e4%3ae330518b%3a1e771326%3ac8618e41%3a854aa0a7%3a5a6d9d23 
 




Symptoms/Cause
When users quickly move RadDocks around on the page the position of the RadDocks seem to get lost and they free float on the page causing javascript errors.  A sure fire way to cause this error seems to be rapidly double clicking on the header bar of a RadDock.  This will eventually result in a JavaScript error in which subsequent actions cause page to have several javascript errors rending the page useless.

Please NOTE:  Double clicking was not the only method used to create the random javascript errors, however it seems to be the best way to easily reproduce the issue.  I think all the javascript errors we have seen stem from the same root issue, whatever that may be.

We have tried several variations of using UpdatePanel and the RadAjaxPanel with Loading Panel.  Any help that anyone can give would be appreciated.

Sample ASPX Page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadAjaxPanelDoesNotWork.aspx.cs" Inherits="WebUI.RadAjaxPanelDoesNotWork" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
</head> 
<body> 
<form id="form1" runat="server"> 
     
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
        </telerik:RadScriptManager> 
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="Column1"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Column1"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column2"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column3"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="Column2"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Column1"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column2"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column3"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="Column3"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Column1"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column2"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Column3"  
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
         
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  
            Skin="Default" MinDisplayTime="500"> 
        </telerik:RadAjaxLoadingPanel> 
         
        <asp:Button ID="btnAdd" OnClick="btnAdd_Click" runat="server" Text="Add Dock"/> 
 
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> 
                    <telerik:RadDockLayout runat="server" ID="radDockLayout" OnSaveDockLayout="radDockLayout_SaveDockLayout" OnLoadDockLayout="radDockLayout_LoadDockLayout"> 
                        <table style="width:99%;"> 
                        <tr> 
                        <td style="width: 30%;" valign="top" runat="server" Id="tblColumn1"> 
                            <telerik:RadDockZone runat="server" ID="Column1" Orientation="vertical" Style="border: 0px; width: 100%; min-height: 400px; min-width:100px"> 
                            </telerik:RadDockZone> 
                        </td> 
                        <td style="width: 30%;" valign="top" runat="server" Id="tblColumn2"> 
                            <telerik:RadDockZone runat="server" ID="Column2" Orientation="vertical" Style="border: 0px; width: 100%; min-height: 400px; min-width:100px"> 
                            </telerik:RadDockZone> 
                        </td>                     
                        <td style="width: 30%;" valign="top" runat="server" Id="tblColumn3"> 
                            <telerik:RadDockZone runat="server" ID="Column3" Orientation="vertical" Style="border: 0px; width: 100%; min-height: 400px; min-width:100px;"> 
                            </telerik:RadDockZone> 
                        </td> 
                        </tr> 
                        </table> 
                    </telerik:RadDockLayout>                   
            </telerik:RadAjaxPanel> 
    </form> 
</body> 
</html> 
 
 


Code Behind
using System; 
using System.Collections.Generic; 
using System.Threading; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
namespace WebUI 
{ 
    public partial class RadAjaxPanelDoesNotWork : System.Web.UI.Page 
    { 
        private IList<DockState> dockStates = new List<DockState>(); 
        private bool shouldSaveDocks = true; 
 
        #region page events 
        protected void Page_Init(object sender, EventArgs e) 
        { 
            LoadDocks(); 
        } 
 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!Page.IsPostBack) 
            { 
                shouldSaveDocks = false; 
            } 
        } 
 
        protected void radDockLayout_LoadDockLayout(object sender, DockLayoutEventArgs e) 
        { 
            //Populate the event args with the state information. The RadDockLayout control 
            //will automatically move the docks according that information. 
            var savedDockStates = GetDockStates(); 
 
            foreach (DockState dockState in savedDockStates) 
            { 
                e.Positions[dockState.UniqueName] = dockState.DockZoneID; 
                e.Indices[dockState.UniqueName] = dockState.Index; 
            } 
        } 
 
        protected void radDockLayout_SaveDockLayout(object sender, DockLayoutEventArgs e) 
        { 
            //Save the dock state in the db. This will enable us 
            // to recreate the dock in the next Page_Init. 
            if (shouldSaveDocks) 
            { 
                List<DockState> dockStatesToSave = ((RadDockLayout)sender).GetRegisteredDocksState(); 
                SaveDockStates(dockStatesToSave); 
            } 
        } 
 
        protected void btnAdd_Click(object sender, EventArgs e) 
        { 
            RadDock dock = CreateRadDock(); 
            Column1.Controls.Add(dock); 
            CreateSaveStateTrigger(dock); 
            dock.Title = "Sample User Control"; 
            LoadWidget(dock); 
        } 
        #endregion 
 
        #region Helper Methods 
        private void LoadDocks() 
        { 
            dockStates = GetDockStates(); 
 
            //Recreate the docks in order to ensure their proper operation 
            foreach (DockState dockState in dockStates) 
            { 
                if (dockState.Closed == false) 
                { 
                    RadDock dock = CreateRadDockFromState(dockState); 
                    //We will just add the RadDock control to the RadDockLayout. 
                    // You could use any other control for that purpose, just ensure 
                    // that it is inside the RadDockLayout control. 
                    // The RadDockLayout control will automatically move the RadDock 
                    // controls to their corresponding zone in the LoadDockLayout 
                    // event (see below). 
                    radDockLayout.Controls.Add(dock); 
                    //We want to save the dock state every time a dock is moved. 
                    CreateSaveStateTrigger(dock); 
                    LoadWidget(dock); 
                } 
            } 
        } 
 
        private IList<DockState> GetDockStates() 
        { 
            List<DockState> _currentDockStates = (List<DockState>)Session["DockStates"]; 
            if (Object.Equals(_currentDockStates, null)) 
            { 
                _currentDockStates = new List<DockState>(); 
                Session["DockStates"] = _currentDockStates; 
            } 
            return _currentDockStates; 
        } 
 
        private void SaveDockStates(IEnumerable<DockState> dockStatesToSave) 
        { 
            Session["DockStates"] = dockStatesToSave; 
        } 
 
        private static RadDock CreateRadDockFromState(DockState state) 
        { 
            var dock = new RadDock { DockModeDockMode = DockMode.Docked, EnableAnimation = true, Skin = "Default", ID = string.Format("RadDock{0}", state.UniqueName) }; 
            dock.ApplyState(state); 
            //dock.EnableAnimation = false; 
            dock.Commands.Add(new DockCloseCommand()); 
            dock.Commands.Add(new DockExpandCollapseCommand()); 
 
            return dock; 
        } 
 
        private static RadDock CreateRadDock() 
        { 
            var dock = new RadDock { DockModeDockMode = DockMode.Docked, EnableAnimation = true, Skin = "Default", UniqueName = Guid.NewGuid().ToString() }; 
            dock.ID = string.Format("RadDock{0}", dock.UniqueName); 
            //dock.EnableAnimation = false; 
            dock.Commands.Add(new DockCloseCommand()); 
            dock.Commands.Add(new DockExpandCollapseCommand()); 
 
            return dock; 
        } 
 
        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; 
 
        } 
 
        private void LoadWidget(RadDock dock) 
        { 
            Control widget = LoadControl("~/UserControls/SampleUserControl.ascx"); 
            dock.ContentContainer.Controls.Add(widget); 
        } 
 
        #endregion 
 
    } 
} 
 


Pero
Telerik team
 answered on 18 Sep 2009
1 answer
173 views
I want the context menu to show on nodes that are dynamically created in the _TreeView_NodeExpand event.  The context menu is displaying instead only on the root node which I don't want.  By the way, I have the very latest version of the ASP.NET AJAX controls.

I create the context menu in the .aspx file as follows:

 

                          <telerik:RadTreeView  ID="AvailableDataFields_TreeView" runat="server"  on  OnClientContextMenuItemClicked="ContextMenuClick"   OnClientDoubleClick="LinkField">  
                           <ContextMenus> 
                               <telerik:RadTreeViewContextMenu runat="server" ID="RadTreeViewContextMenu1" ClickToOpen="True" > 
                                   <Items> 
                                    <telerik:RadMenuItem   ImageUrl="../../images/Data.gif" Text="Add to Data Tab"></telerik:RadMenuItem> 
                                    <telerik:RadMenuItem ImageUrl="../../images/Filter.gif" Text="Add to Filter Tab"></telerik:RadMenuItem> 
                                    <telerik:RadMenuItem ImageUrl="../../images/Sort.gif" Text="Add to Order Tab"></telerik:RadMenuItem> 
                                   </Items>                        
                               </telerik:RadTreeViewContextMenu> 
                           </ContextMenus> 
                        </telerik:RadTreeView> 

Then in the Page_Load event I add nodes to the tree dynamically and this node level displays the context menu which I don't want.
            oData = oCmd.ExecuteReader  
            Do While oData.Read  
                Dim oNode As New RadTreeNode  
 
                sDesc = oData("Description").ToString  
                If sDesc.Length > 50 Then  
                    sDescsDesc = sDesc.Substring(0, 49) & "..."  
                End If  
 
                With oNode  
                    .ToolTip = "Alias: " & oData("Alias").ToString & vbCrLf & "Description: " & sDesc  
                    .Value = oData("TableID")  
                    .ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
                    .Text = oData("Alias").ToString  
                End With  
 
                AvailableDataFields_TreeView.Nodes.Add(oNode)  
 
            Loop  
 

When I get to the NodeExpand event I add more nodes but the context menu doesn't show there.

 
            Do While oData.Read  
                Dim oNode As New RadTreeNode  
 
                With oNode  
                    .ToolTip = sTooltip 
                    .Text = oData("Alias").ToString  
                    .ExpandMode = TreeNodeExpandMode.ClientSide  
                    .Value = oData("FieldID")  
                    .ContextMenuID = "Report" 
                    .CssClass = "TreeInnerNode" 
                    .HoveredCssClass = "TreeInnerNodeOver" 
                    .EnableContextMenu = True 
                End With  
 
                e.Node.Nodes.Add(oNode) 

What should I do to display the nodes on the correct level?  If I put .EnableContextMenu = false on the first level then there are no context menus anywhere on the tree.

Veselin Vasilev
Telerik team
 answered on 18 Sep 2009
1 answer
139 views
Hi,

I am using radeditor.

When i export the radeditor content to pdf.
It show me the pdf without formatting.
In RadEditor for every newline it create br tag.
But while exporting to pdf it remove all the br tag.

The Format suppose i type in radeditor as

" Hi,

 To Acs,

      Txy........


Regards,
Xyz "


while exporting to pdf it show me the  as below.

" Hi,
 To Acs,
      Txy........
Regards,
Xyz "


So how can i maintain the same formatting while exporting to pdf ?

Thanks.


 
Rumen
Telerik team
 answered on 18 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?