Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
75 views
I'm building up the contents of a RadMenu from database tables.  To improve performance on repeat visits to my page, I'm caching the XML representation of the menu, so that I can build the RadMenu instance from XML and avoid the DB hit on subsequent visits.  However, I'm finding the the RadMenu.GetXml() call is very slow.  According to AQTime profiles, it takes about 0.89 seconds on average.  This is for a relatively small menu, with 6 or 7 items, some of which contain custom attributes.  Is this performance normal and expected?  Any thoughts, suggestions?  Thanks,

-Daire
Daire
Top achievements
Rank 1
 asked on 16 Sep 2008
4 answers
234 views
using the q2 version, I placed a "subgurim.net" google map control inside of the tooltip...

click location, and then enter a zipcode, and submit...

then choose a location closest to you...

the little compass icon in the header bar... hover over that to get the google maps api tooltip...

the issue is that it doesnt load all the squares of the map.. and i know this control has no issues without the wrapper of the tooltip... (http://rosemurgyproperties.com/retail (just select a property and you will see the same googlemap api control without the tooltip wrapper.. it works perfectly. (I used the same code to instantiate it)

http://giovanniscoalfirepizza.com

any suggestions?

thanks!


Jeff
Svetlina Anati
Telerik team
 answered on 16 Sep 2008
4 answers
214 views
Hi,

I'm using the Prometheus version of your controls, particularly version 2007.3.1314.20, and for some reason the SelectedDateChanged event of the radDatePicker is firing twice.

This is my html code:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TelerikCalendarTest._Default" %> 
<%@ 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>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
         
    <div> 
    <telerik:RadScriptManager ID="tsmScriptManager" runat="server" EnablePartialRendering="true" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
            <AjaxSettings> 
                <telerik:AjaxSetting> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="test" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
            Width="75px"
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
                style="border: 0px;" /> 
        </telerik:RadAjaxLoadingPanel> 
  
    <telerik:RadDatePicker ID="test" runat="server" AutoPostBack="true"></telerik:RadDatePicker> 
    </div> 
    </form> 
     
</body> 
</html> 

And this is the source code:

Imports Telerik.Web.UI 
Imports System.Collections.Generic 
 
 
 
Partial Public Class _Default 
    Inherits System.Web.UI.Page 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
         
 
    End Sub 
 
    Private Sub test_SelectedDateChanged(ByVal sender As ObjectByVal e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs) Handles test.SelectedDateChanged 
 
    End Sub 
End Class 

So I put in a break point for the SelectedDateChanged event and it's always firing off twice, and in the big project I'm working on that makes some things not work as expected.  Do you guys know why this is happening?
Chris
Top achievements
Rank 1
 answered on 16 Sep 2008
5 answers
218 views
Is there a way to create new radwindows from the clientside via javascript so they are configured before being displayed?

I want to set their behaviour and size and position based on whats been passed to the javascript function that creates the window before it gets displayed.

Whenever I call the radopen or radwindow.open functions it displays the window before I can configure it which results in some ugly post-display changes.

This is what I currently have...

// retrieve the radwindowmanager for the page  
var oManager = null;  
 
 
function mainOpenWindow(name, url, winid, buttons, tabs, width, height, left, top, pinned) {  
    /* 
    This function dynamically creates a new rad window configured in a curtain way
    url: target url for inner window
    winid: id for the window
    buttons: what buttons to display
    tabs: 0 = use tabs, 1 = use new window
    width, height, left, top: window position
    pinned: is window pinned
    */ 
    if (!oManager) oManager = GetRadWindowManager();  
 
    var oWindow = oManager.open(url, null);  
    oWindow.set_behaviors(buttons);  

Is there a way for me to create a new radwindow, set its properties, attach it to the radwindowmanager and then display it?
Georgi Tunev
Telerik team
 answered on 16 Sep 2008
2 answers
216 views
HI All,
            i want to change my grid's row color from javascript.My requirement is that once user selects any rows,i want to change its color so he can come to know that he has visited this row.

can any one suggest how to do this?

Thanks
Amit Champaneri
Amit
Top achievements
Rank 2
 answered on 16 Sep 2008
7 answers
322 views

I know there are several posts on this topic, but the common answer seems to be, "Make sure all docks are created in the Page_Init" event.  As far as I can tell, I've done that.  (Using a modified implementation of the Portal example.)

Config is saved to the database as part of the CurrentDockStates property.

I hate to post a mountain of code, but I'm pretty much stuck.

The viewstate error occurs without any real regularity, but once it starts, it doesn't seem to stop until I reset all the docks.  It seems to happen most often after deleting a dock.

Many of my docks contain forms, some have timers, their own update panels, etc.  I'm guessing that turning off viewstate is not an option...?

Imports System  
Imports System.Collections  
Imports System.Collections.Generic  
Imports System.ComponentModel  
Imports System.Data  
Imports System.Drawing  
Imports System.Web  
Imports System.Web.SessionState  
Imports System.Web.UI  
Imports System.Web.UI.WebControls  
Imports System.Web.UI.HtmlControls  
Imports Telerik.Web.UI  
Imports UserFunctions  
Imports Messages  
Imports Permissions  
 
Namespace Telerik.Web.Examples.Dock.MyPortal  
    Partial Public Class DefaultVB  
        Inherits System.Web.UI.Page  
 
        Private Property CurrentDockStates() As List(Of DockState)  
            Get  
                Dim _currentDockStates As List(Of DockState) = DirectCast(Session("UserPreferences.PortalSession"), List(Of DockState))  
                If [Object].Equals(_currentDockStates, Nothing) Then  
                    'Make an empty configuration list  
                    _currentDockStates = New List(Of DockState)()  
                    'Convert our stored config to the active config  
                    Dim strLoadedConfig As String = GetUserPreference("PortalConfiguration")  
                    'If we found nothing, leave the current state empty  
                    If strLoadedConfig <> "" Then  
                        Try  
                            'Use the stored config  
                            'Convert the stored config to an array, splitting at the *s  
                            Dim aConfig As Array = Split(strLoadedConfig, "*")  
                            Dim strConfigItem As String  
                            Dim dsWorking As DockState  
                            'Parse through the array, turning the dockstate strings into dockstates  
                            'Then add the dockstates to the dockstate list  
                            For Each strConfigItem In aConfig  
                                'Start a fresh dockstate  
                                dsWorking = New DockState  
                                'Parse the string back into dock settings  
                                dsWorking = DockState.Deserialize(strConfigItem)  
                                'Add the settings back into the current session  
                                _currentDockStates.Add(dsWorking)  
                            Next  
                        Catch ex As Exception  
                            'Something was wrong with the data  
                            'Default back to blank so the page won't crash  
                        End Try  
                        'Set the new value into the session variable  
                        Session("UserPreferences.PortalSession") = _currentDockStates  
                    Else  
                        'No config stored; use the default, speficied below  
                        'Quotes changed to apostrophes for string-friendly input  
                        Dim strDefaultConfig = "[DEFAULT DOCK CONFIGURATION STRING HERE...]" 
                        UpdateUserPreference("PortalConfiguration", Replace(strDefaultConfig, "'", """"))  
 
                        Try  
                            'Now, use the newly saved default config to generate the docks  
                            'The UpdateUserPreference routine would have already stored it in a session  
                            'Convert the stored config to an array, splitting at the *s  
                            Dim aConfig As Array = Split(Session("UserPreferences.PortalConfiguration"), "*")  
                            Dim strConfigItem As String  
                            Dim dsWorking As DockState  
                            'Parse through the array, turning the dockstate strings into dockstates  
                            'Then add the dockstates to the dockstate list  
                            For Each strConfigItem In aConfig  
                                'Start a fresh dockstate  
                                dsWorking = New DockState  
                                'Parse the string back into dock settings  
                                dsWorking = DockState.Deserialize(strConfigItem)  
                                'Add the settings back into the current session  
                                _currentDockStates.Add(dsWorking)  
                            Next  
                        Catch ex As Exception  
                            'Something was wrong with the data  
                            'Default back to blank so the page won't crash  
                        End Try  
                        'Set the new value into the session variable  
                        Session("UserPreferences.PortalSession") = _currentDockStates  
                    End If  
                End If  
                Return _currentDockStates  
            End Get  
            Set(ByVal value As List(Of DockState))  
                Session("UserPreferences.PortalSession") = value  
                'Session being updated; Update the database too  
                'Convert list of dockStates to a delimited string  
                'We'll use * since commas are used in the dockStates  
                Dim sbListConverter As New System.Text.StringBuilder  
                For Each dockState As DockState In value  
                    sbListConverter.AppendFormat("{0}*", dockState.ToString)  
                Next  
                Dim strDockConfig As String = sbListConverter.ToString.TrimEnd(Convert.ToChar("*"))  
                'Save string to database  
                UpdateUserPreference("PortalConfiguration", strDockConfig)  
            End Set  
        End Property  
 
 
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)  
 
 
            If Not IsPostBack Then  
 
                'Add the dock CSS files to the master page  
                Dim newStyleSheet As New HtmlLink()  
                newStyleSheet.Href = "skins/LightGreen/Dock.LightGreen.css" 
                newStyleSheet.Attributes.Add("type", "text/css")  
                newStyleSheet.Attributes.Add("rel", "stylesheet")  
                Page.Header.Controls.Add(newStyleSheet)  
 
            End If 'Not Postback  
 
 
        End Sub  
 
 
        Public Function GetZones() As ArrayList  
            Dim zones As New ArrayList()  
            zones.Add(zoneLeft)  
            zones.Add(zoneRight)  
            Return zones  
        End Function  
 
 
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)  
 
            Dim i As Integer = 0 
            While i < CurrentDockStates.Count 
                If CurrentDockStates(i).Closed = False Then  
                    Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i))  
                    RadDockLayout1.Controls.Add(dock)  
                    CreateSaveStateTrigger(dock)  
                    LoadWidget(dock)  
                End If  
                System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)  
            End While  
        End Sub  
 
 
        Protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)  
            For Each state As DockState In CurrentDockStates  
                e.Positions(state.UniqueName) = state.DockZoneID  
                e.Indices(state.UniqueName) = state.Index  
            Next  
        End Sub  
 
 
        Protected Sub RadDockLayout1_SaveDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)  
            CurrentDockStates = RadDockLayout1.GetRegisteredDocksState()  
        End Sub  
 
 
        Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock  
            Dim dock As New RadDock()  
            dock.ID = String.Format("RadDock{0}", state.UniqueName)  
            dock.ApplyState(state)  
            AddHandler dock.Command, AddressOf dock_Command  
            dock.Commands.Add(New DockCloseCommand())  
            dock.Commands.Add(New DockExpandCollapseCommand())  
            dock.EnableEmbeddedSkins = False 
            dock.Skin = "LightGreen" 
            Return dock  
        End Function  
 
 
        Private Function CreateRadDock() As RadDock  
            Dim docksCount As Integer = CurrentDockStates.Count  
            Dim dock As New RadDock()  
            dock.UniqueName = Guid.NewGuid().ToString()  
            dock.ID = String.Format("RadDock{0}", dock.UniqueName)  
            dock.Title = "" 
            dock.Text = "" 
            dock.Commands.Add(New DockCloseCommand())  
            dock.Commands.Add(New DockExpandCollapseCommand())  
            dock.EnableEmbeddedSkins = False 
            AddHandler dock.Command, AddressOf dock_Command  
            Return dock  
        End Function  
 
 
        Sub dock_Command(ByVal sender As Object, ByVal e As DockCommandEventArgs)  
            If e.Command.Name = "Close" Then  
                ScriptManager.RegisterStartupScript(UpdatePanel1, Me.[GetType](), "RemoveDock", String.Format("function _removeDock() {{" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "Sys.Application.remove_load(_removeDock);" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{0}').undock();" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$get('{1}').appendChild($get('{0}'));" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{0}').doPostBack('DockPositionChanged');" & Chr(13) & "" & Chr(10) & "}};" & Chr(13) & "" & Chr(10) & "Sys.Application.add_load(_removeDock);", (DirectCast(sender, RadDock)).ClientID, UpdatePanel1.ClientID), True)  
            End If  
        End Sub  
 
 
        Private Sub CreateSaveStateTrigger(ByVal dock As RadDock)  
            dock.AutoPostBack = True 
            dock.CommandsAutoPostBack = True 
            Dim saveStateTrigger As 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)  
        End Sub  
 
 
        Private Sub LoadWidget(ByVal dock As RadDock)  
            If String.IsNullOrEmpty(dock.Tag) Then  
                Return  
            End If  
            Dim widget As Control = LoadControl(dock.Tag)  
            dock.ContentContainer.Controls.Add(widget)  
        End Sub  
 
 
        Protected Sub ButtonAddDock_Click(ByVal sender As Object, ByVal e As EventArgs)  
            Dim dock As RadDock = CreateRadDock()  
            UpdatePanel1.ContentTemplateContainer.Controls.Add(dock)  
            ScriptManager.RegisterStartupScript(dock, Me.[GetType](), "AddDock", String.Format("function _addDock() {{" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "Sys.Application.remove_load(_addDock);" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{1}').dock($find('{0}'));" & Chr(13) & "" & Chr(10) & "" & Chr(9) & "$find('{0}').doPostBack('DockPositionChanged');" & Chr(13) & "" & Chr(10) & "}};" & Chr(13) & "" & Chr(10) & "Sys.Application.add_load(_addDock);", dock.ClientID, DropDownZone.SelectedValue), True)  
            CreateSaveStateTrigger(dock)  
            dock.Title = DroptDownWidget.SelectedItem.Text  
            dock.Tag = DroptDownWidget.SelectedValue  
            'Style the dock, based upon its content  
            dock.Skin = "LightGreen" 
            LoadWidget(dock)  
        End Sub  
 
    End Class  
End Namespace  
 
Sophy
Telerik team
 answered on 16 Sep 2008
5 answers
136 views
I'm looking to have a Page X of Y for the rotator.  I'm very close, but can't seem find any documentation on how to get the current index on the client side.

I have the following

<script type="text/javascript"
        function itemShown_handler(sender, args) { 
            alert(sender.get_id() + " has changed a frame"); 
        } 
    </script> 

What should I be doing to get the index?

Thanks.
Georgi Tunev
Telerik team
 answered on 16 Sep 2008
1 answer
87 views
I am working with a new client who has a tab strip, it has two rows of tabs and I am forcing the row with a break.  It works fine in IE, but Chrome, Firefox, Opera (basically any non-IE browser) displays one row of tabs, the content of the selected tab and the second row beneth the content.  Any thoughts?? 

Also, is there a way to validate what version of control they are using?  ASP.net or ASP.net Ajax or even what release?  I have used the controls some, but not enough to know this.

Thanks in Advance!!

John
Paul
Telerik team
 answered on 16 Sep 2008
1 answer
101 views
I know that you can restrict single file upload size limits, but how can I enforce a storage size limitation? Say I only want to allow a user to be able to store up to 50mb in the upload folder in total, regardless of how many file they upload. What is the recommended way to accomplish this?
George
Telerik team
 answered on 16 Sep 2008
1 answer
147 views
Hi,

I need some advice on how to accomplish the following.  I want to be able to display Appointments without being restricted to the Default Scheduler views.  I need to accomplish something like the following pseudo code...

ArrayList arr = new ArrayList();
foreach(Appointment on a given day) //need to be able to pass in date
    arr.Add(Appointment)
....
Then I can loop through all the Appointments and display information about them.

Thanks!
Rhys
Peter
Telerik team
 answered on 16 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?