Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
I have a RadPanelGrid that I dynamically add RadPanelItems from the runtime Page Load. On these RadPanelItems are RadGrids which are also dynamically populated from the original page load. Whenever I click on any RadPanelItem which has a grid on it, I want the item to simply expand and display the grid. It is currently doing this, but then firing a postback which calls the page load again. This means that the "dynamic grid adding code" in the Page load happens EVERY time a click happens (rather than just once when the page loaded), otherwise when I click on a RadPanelItem, it expands, posts back, and my grids disappear.

With my current solution, just clicking on an item causes it to expand, postback, and have the grid re-added, when in reality, if there were no postback, this "grid adding code" would not need to be run every time. How do I switch off postbacks for dynamically added rad panel items? I have tried it at runtime, but it doesn't work, and the documentation does support this fact that it should NOT work, so how should I do it then?

I am already harnessing the client side "OnClientItemClicked" event, as I need to do some client side activity when an item is clicked. I do not however want it to post back server side really, as I already have my grids and display complete, and do not need to. I have read some previous threads suggesting that a: 

e.set_cancel(true);


in the client side function is the way to prevent a server side postback, but it doesn't like "set_cancel" as a property of the event args, and is subsequently giving me a: "Object doesn't support this property or method".

The RadPanelBar is on the form at design time, so if there is a property on there that I can set to stop it doing any postbacks then great, otherwise, it will either need to be a property on the runtime added items, or potentially a "slight hack" in the client side script, to prevent the post back after the click. Any solution suits really, but this continual server side post back is having a huge performace hit on the app, so I need to get it ceased. Any help would be greatly appreciated.

  
Nikolay Tsenkov
Telerik team
 answered on 10 Jun 2010
2 answers
165 views

Hi Telerik,

I have seen the Documentation for RadGrid usercontrol but sometimes it uses the RadGrid control from the Telerik.WebControls namespace. I am using the RadGrid control from the Telerik.Web.UI namespace.  Could you provide me any posts or links on how to perform add, modify and delete operations on the data in the RadGrid.

Thanks



Akhilaa
Top achievements
Rank 1
 answered on 10 Jun 2010
8 answers
304 views
Hello -
Trying to use the TimelineView -

First Question: How do I set the width of the Grouping column?  (Screenshot #1, the column that says "TP Room" is too small).

Second Question:
I would like the Timeline to show only the availability hours between 7 AM to 23 PM.
I've set DayStartTime="07:00:00" DayEndTime="23:00:00" and also WorkDayStartTime="07:00:00" WorkDayEndTime="23:00:00".
But still when I navigate back 1 day, it will show the hours just before 7 AM (see Screeshot #2).

Also when I use the Date Picker to select a random date, it will display from 00 AM, and not from 7 AM to 23 PM as specified...

Here is my ASP code:
        <telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="TimelineView" ColumnWidth="60px" 
            SelectedDate="2010-03-24 07:00:00" DayStartTime="07:00:00" DayEndTime="23:00:00" 
            DataSourceID="MeetingsDataSource" DataKeyField="MeetingID" DataStartField="StartDate" 
            DataEndField="EndDate" DataDescriptionField="Subject" DataSubjectField="Subject"> 
            <TimelineView SlotDuration="01:00:00" NumberOfSlots="16" GroupBy="Room" GroupingDirection="Vertical" 
                ShowDateHeaders="true" ColumnHeaderDateFormat=" H" /> 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="RoomsDataSource" ForeignKeyField="RoomID" 
                    KeyField="RoomID" Name="Room" TextField="RoomName" /> 
            </ResourceTypes> 
        </telerik:RadScheduler> 

cheers!
 -bash
T. Tsonev
Telerik team
 answered on 10 Jun 2010
1 answer
170 views
Hi

I'm using the filter template and have a radComboBox with a select to display a list of options. What I'm doing id populating the gid with a call to a database, then populating the combobox with another call to the database.

Is it possible to populate the combobox from the already downloaded grid data, this would serve 2 purposes, 1 - one less database call and 2 - the combo box would only have that data which exists in the grid whtout a complcated where clause.

Andy
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2010
5 answers
116 views
Hi to all!

I have my principal page that have a control with a toolbar and radAjaxPanel.
The toolbar have the icon for save, adding, modify, delete, foword, back. My question is how i send the event of the click in the button save to the control loaded in the radAjaxPanel?

Maria Ilieva
Telerik team
 answered on 10 Jun 2010
1 answer
231 views
Hi,

I have a RadTreeView with dynamic items, dynamically added on server-side. The RadTreeView has 2 ContextMenues declared in HTML, on server-side I set the ContextMenueID-Property depending on an attribute from the database (simplified in the example)

If I run the site, I get a Javascript error "menu is null" on line "var items = menu.get_items();"

This used to work before, but I don't know version I used back then.
Now I'm using newest release 2010.1.519(.40)

Here's the aspx-Content:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="Intranet.test" %> 
<%@ 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 id="Head1" runat="server"> 
    <title>Intranet</title> 
</head> 
 
<body style=" background-color:White;"> 
    <form id="form1" method="post" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server"> 
    </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
        </telerik:RadAjaxManager> 
 
        <div class="divMenue">  
            <telerik:RadAjaxPanel ID="rap_Menue" runat="server" ClientIDMode="Static"> 
                <telerik:RadTreeView ID="rtv_Menue" ClientIDMode="Static" Runat="server" DataNavigateUrlField="URL" 
                    DataTextField="Title" EnableViewState="true" 
                    AfterClientToggle="AfterClientToggle" EnableDragAndDrop="True"                          
                    EnableDragAndDropBetweenNodes="True" LoadingMessage="Wird geladen ..." OnClientContextMenuShowing="ClientContextMenuShowing"               
                    Skin="Default" OnClientLoad="setTree" > 
                    <ContextMenus> 
                        <telerik:RadTreeViewContextMenu ID="ctm_FavMenu" runat="server"  
                Skin="Default">                         
                            <Items> 
                                <telerik:RadMenuItem runat="server" Text="New"> 
                                    <Items> 
                                        <telerik:RadMenuItem> 
                                            <ItemTemplate> 
                                                <table> 
                                                    <tr> 
                                                        <td>Name:</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavName" Width="300px" /></td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td>URL</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavURL" Width="300px" /></td> 
                                                    </tr>                 
                                                    <tr> 
                                                        <td>Icon</td> 
                                                        <td> 
                                                            <asp:RadioButtonList runat="server" RepeatColumns="8" ID="rbl_FavIcon" /> 
                                                        </td> 
                                                    </tr>                                                 
                                                </table>                 
                                            </ItemTemplate> 
                                        </telerik:RadMenuItem> 
                                        <telerik:RadMenuItem runat="server" IsSeparator="true"/> 
                                        <telerik:RadMenuItem runat="server" Text="Speichern"/> 
                                    </Items> 
                                </telerik:RadMenuItem> 
                                <telerik:RadMenuItem runat="server" Text="Edit"> 
                                    <Items> 
                                        <telerik:RadMenuItem> 
                                            <ItemTemplate> 
                                                <table> 
                                                    <tr> 
                                                        <td>Name:</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavNamechng" Width="300px" /></td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td>URL</td> 
                                                        <td><asp:TextBox runat="server" ID="txt_FavURLchng" Width="300px" /></td> 
                                                    </tr>                 
                                                    <tr> 
                                                        <td>Icon</td> 
                                                        <td> 
                                                            <asp:RadioButtonList runat="server" RepeatColumns="8" ID="rbl_FavIconchng" /> 
                                                        </td> 
                                                    </tr>                                                 
                                                </table>                 
                                            </ItemTemplate> 
                                        </telerik:RadMenuItem> 
                                        <telerik:RadMenuItem runat="server" IsSeparator="true"/> 
                                        <telerik:RadMenuItem runat="server" Text="Speichern"/> 
                                    </Items> 
                                </telerik:RadMenuItem> 
                                <telerik:RadMenuItem runat="server" Text="Löschen" /> 
                            </Items> 
                        </telerik:RadTreeViewContextMenu> 
                        <telerik:RadTreeViewContextMenu ID="ctm_NormMenu" runat="server" Skin="Default">                         
                            <Items> 
                                <telerik:radmenuitem runat="server" Text="Add to Favorits" /> 
                            </Items> 
                        </telerik:RadTreeViewContextMenu> 
                    </ContextMenus> 
                </telerik:RadTreeView>     
            </telerik:RadAjaxPanel>               
        </div>  
 
    <telerik:RadScriptBlock ID="rsb_getTree" runat="server"> 
        <script type="text/javascript" language="javascript"> 
            var tree; 
            window.onbeforeunload = onRequestStart; 
 
            function setTree(sender, eventArgs) { 
                tree = $find('<%=rtv_Menue.ClientID%>'); 
            } 
 
            function createCookie() { 
                var toggleActions = ""; 
                var nodes; 
                var node; 
 
                nodes = tree.get_allNodes(); 
 
                for (var i = 1; i < nodes.length; i++) { 
                    node = nodes[i] 
                    if (node.get_expanded()) { 
                        toggleActions += node.get_value() + '*'; 
                    } 
                } 
                var date = new Date(); 
                date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000)); 
                var expires = "; expires=" + date.toGMTString(); 
 
                document.cookie = "TreeToggleActions=" + toggleActions + expires + "; path=/"; 
            } 
 
            function onRequestStart(sender, arguments) { 
                createCookie(); 
            } 
 
            function onResponseEnd(sender, arguments) { 
                isUpdatingAppointment = false; 
            } 
 
            function ClientContextMenuShowing(sender, eventArgs) { 
                var node = eventArgs.get_node(); 
                var menu = eventArgs.get_menu();
                var items = menu.get_items(); //Error is thrown here, "menu is null"
 
                document.getElementById('txt_FavNamechng').value = node.get_text(); 
                document.getElementById('txt_FavURLchng').value = node.get_navigateUrl(); 
 
            } 
 
        </script> 
    </telerik:RadScriptBlock> 
 
    </form> 
</body> 
</html> 
 


And the CodeBehind:
Imports Telerik.Web.UI 
 
Public Class test 
    Inherits System.Web.UI.Page 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        Dim node = New RadTreeNode() 
        node.Text = "TestNode" 
        node.ContextMenuID = "ctm_FavMenu" ''same with ctm_NormMenu 
        rtv_Menue.Nodes.Add(node) 
    End Sub 
 
End Class 



Any help is appreciated,

Lukas
Nikolay Tsenkov
Telerik team
 answered on 10 Jun 2010
2 answers
68 views
I use RadEditor lite for MOSS2007 (free version) to edit list items.
Steps to reproduce:
- Click New button to start creating a new item
- use MOSSLinkManager to insert a link into one RTE. It works.
- Use Backspace key to delete the link (the RTE become blank)
- use MOSSLinkManager to insert a link. It does not work.
Truong Hong Thi
Top achievements
Rank 1
 answered on 10 Jun 2010
4 answers
399 views
I've just moved to the Telerik Ajax controls from standard .Net controls and am finding the page load times to be incredibly slow.

I've got a simple Rad Window popup box that contains a couple of text boxes and a combo box (5 records) and the page load time is around 5 seconds which is far too long.

I'm using the RadScriptManager, StyleSheetManager and AjaxManager, along with setting web config debug=false but still none of this has made a difference.  I've even removed all the controls but the load time is still extremelly slow...

Code below, hopefully you can tell me where I'm going wrong...

Cheers
Cliff

Master Page for popup:

<%

 

@ Master Language="C#"

 

 

 

AutoEventWireup="true"

 

 

 

CodeFile="MasterPageDialogs.master.cs"

 

 

 

Inherits="MasterPageDialogs"

 

%>

<%

 

@ 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">

 

 

 

<asp:ContentPlaceHolder id="head" runat="server">

 

 

 

</asp:ContentPlaceHolder>

 

</

 

 

head>

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

 

 

 

<telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Windows7"></telerik:RadSkinManager>

 

 

 

<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"></telerik:RadStyleSheetManager>

 

 

 

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Windows7" />

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>

 

 

 

<div>

 

 

 

<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

 

 

 

 

</asp:ContentPlaceHolder>

 

 

 

</div>

 

 

 

 

<!-- Popup Dialog/Windows, e.g. MessageBox -->

 

 

 

 

<telerik:RadWindowManager ID="RadWindowManager" runat="server"

 

 

 

Behavior="Default" InitialBehavior="None" EnableViewState="False">

 

 

 

<Windows>

 

 

 

<telerik:RadWindow runat="server" ID="RadWindowMessageBox" Behavior="Default" InitialBehavior="None"

 

 

 

NavigateUrl="~/Dialogs/MessageBox.aspx" ReloadOnShow="true" Animation="None"

 

 

 

Height="150px" Modal="true" Title="MessageBox" Width="350px" AnimationDuration="750" Behaviors="Close" Enabled="True" VisibleStatusbar="False" IconUrl="~/favicon.ico">

 

 

 

</telerik:RadWindow>

 

 

 

</Windows>

 

 

 

</telerik:RadWindowManager>

 

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 



POPUP aspx:

<%

 

@ Page Title=""

 

 

 

Language="C#"

 

 

 

MasterPageFile="~/MasterPageDialogs.master"

 

 

 

AutoEventWireup="true"

 

 

 

CodeFile="CreateTask.aspx.cs"

 

 

 

Inherits="Dialogs_CreateTask"

 

%>

<%

 

@ MasterType VirtualPath="~/MasterPageDialogs.master" %>

 

<%

 

@ 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">

 

<

 

 

telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"></telerik:RadAjaxManagerProxy>

 

 

 

 

<script type="text/javascript">

 

 

 

function GetRadWindow() {

 

 

 

var oWindow = null;

 

 

 

if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog

 

 

 

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)

 

 

 

return oWindow;

 

}

 

 

function CloseOnReload() {

 

GetRadWindow().close();

}

 

 

function RefreshParentPage() {

 

GetRadWindow().BrowserWindow.location.href = GetRadWindow().BrowserWindow.location.href;

}

 

 

</script>

 

 

 

<table cellpadding="1" cellspacing="1" border="0" width="100%">

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:Label ID="lblTitle" runat="server" Text="Title:"></asp:Label>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="txtTitle" runat="server" Width="290px"></telerik:RadTextBox>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="txtDescription" runat="server" Width="290px" ></telerik:RadTextBox>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:Label ID="lblEvent" runat="server" Text="Event:"></asp:Label>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadComboBox ID="cboEvents" Runat="server" Width="290px"></telerik:RadComboBox>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:Label ID="lblDueDate" runat="server" Text="Due Date:"></asp:Label>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadDatePicker runat="server" ID="RadDatePickerDueDate"></telerik:RadDatePicker>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td colspan="2">

 

 

 

&nbsp;

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr align="center">

 

 

 

<td colspan="2">

 

 

 

<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"></asp:Button>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

</

 

 

asp:Content>

 

 

POPUP Code:

 

using

 

 

System;

 

 

 

 

using

 

 

Telerik.Web.UI;

 

 

 

 

public

 

 

partial class Dialogs_CreateTask : System.Web.UI.Page

 

 

 

 

 

{

 

 

 

#region

 

 

Events

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

try

 

 

 

 

 

{

 

 

if (!IsPostBack)

 

{

LoadEvents();

}

}

 

 

catch (Exception ex)

 

{

Master.ShowMsgBoxPopup(

 

"Error Loading Page", Napp_ErrorTrapping.BuildExeceptionMessage(ex));

 

}

}

 

 

protected void btnSave_Click(object sender, EventArgs e)

 

{

 

 

try

 

 

 

 

 

{

 

 

string result = ControlsAreValid();

 

 

 

if (result == "Success")

 

{

 

 

string username = Page.User.Identity.Name;

 

 

 

string taskID = EM_Data.CreateTask(txtTitle.Text,

 

txtDescription.Text,

username,

RadDatePickerDueDate.SelectedDate.ToString(),

 

 

int.Parse(cboEvents.SelectedValue));

 

Session.Add(

 

"ACTION", "TASK ADDED");

 

Session.Add(

 

"TASK_ID", taskID);

 

 

 

RadScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "RefreshParentPage();", true);

 

 

 

RadScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "CloseOnReload();", true);

 

}

 

 

else

 

 

 

 

 

{

Master.ShowMsgBoxPopup(

 

"Cannot Save Task", result);

 

}

}

 

 

catch (Exception ex)

 

{

Master.ShowMsgBoxPopup(

 

"Cannot Save Task", Napp_ErrorTrapping.BuildExeceptionMessage(ex));

 

}

}

 

 

 

#endregion

 

 

 

 

#region

 

 

Methods

 

 

 

private string ControlsAreValid()

 

{

 

 

string result = "Success";

 

 

 

if (txtTitle.Text == "")

 

result =

 

"Please enter a 'Title' for this task.";

 

 

 

if (RadDatePickerDueDate.SelectedDate == null)

 

result =

 

"Please enter a 'Due Date' for this task.";

 

 

 

if (cboEvents.SelectedValue == "0")

 

result =

 

"Please select an 'Event' for this task.";

 

 

 

 

 

return result;

 

}

 

 

private void LoadEvents()

 

{

cboEvents.DataValueField =

 

"EventID";

 

cboEvents.DataTextField =

 

"EventTitle";

 

cboEvents.DataSource =

 

EM_Data.SearchEvents(Page.User.Identity.Name, true);

 

cboEvents.DataBind();

}

 

 

 

#endregion

 

 

 

 

}

T. Tsonev
Telerik team
 answered on 10 Jun 2010
8 answers
232 views
Hi All,

I have a problem. i have a page in which i have a button. and i have another page (user control) in which i have rad date picker named as rdDate. i show this page in div. now i want to do that by clicking on button i want to set date of rdDate. date which i provide. how can i do this.???


Please help. thanks

Radoslav
Telerik team
 answered on 10 Jun 2010
1 answer
111 views
Hi,
       I have a column in grid which I am hiding (Display="false") from users,and on click of a button I am accesing values from that column.I am using  HeaderContextMenu, form which user will be able to select and unselect the column(for personalization perpose i am giving this option to user).
                              The problem is that the hidden columns are also visible in  HeaderContextMenu.I want that those hidden columns should not come in  HeaderContextMenu. Please suggest me How to remove HeaderContextMenu - column values.

Regards,
Dheeraj         
Iana Tsolova
Telerik team
 answered on 10 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?