Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
254 views
Hello,
I am posting a simplified version of my code to demonstrate the problem I am having. 
If I click on a menu item, one window opens.
Then, if I click on another menu item, TWO window open. Following clicks cause two windows to open.
I only want one window to open at a time.
If I remove ajax, it works fine.

It seems like Sys.Application.add_load(OpenWindow1) is not being rendered on the page. Not sure why.

Please help.

Thanks,
Simone


       cs:
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void subMenu_ItemClick(object sender, RadMenuEventArgs e)
    {
        switch (e.Item.Value)
        {
            case "Window1":
                {
                    if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow1"))
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow1", "Sys.Application.add_load(OpenWindow1);", true);
                }
                break;
 
            case "Window2":
                {
                    if (!ClientScript.IsStartupScriptRegistered("OpenStartupWindow2"))
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenStartupWindow2", "Sys.Application.add_load(OpenWindow2);", true);
                }
                break;              
        }
    }
}


aspx:
<body>
 
    <div id="div1" runat="server">
        <script type="text/javascript">
            function OpenWindow1() {
                var oWnd = radopen("WebForm1.aspx", "wndWebForm1");
            }
            function OpenWindow2() {
                var oWnd = radopen("WebForm2.aspx", "wndWebForm2");
            }
        </script>
    </div>
 
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
 
    <telerik:RadWindowManager ID="RadWindowManagerEmails" ShowContentDuringLoad="false"
        VisibleStatusbar="false" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="wndWebForm1" runat="server" Behaviors="Close,Move,Resize"
                 Width="1100" Height="600" NavigateUrl="WebForm1.aspx">
            </telerik:RadWindow>
            <telerik:RadWindow ID="wndWebForm2" runat="server" Behaviors="Close,Move,Resize"
                 Width="600" Height="600"
                NavigateUrl="WebForm2.aspx">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
 
        <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="subMenu">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="txt1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <div style="display: block; width: 100%; height: 30px;">
        <telerik:RadMenu ID="subMenu" runat="server" EnableViewState="false" Orientation="Horizontal"
            SkipLinkText="" CausesValidation="true" OnItemClick="subMenu_ItemClick">
            <Items>
                <telerik:RadMenuItem Text="Open Window 1" Value="Window1" />
                <telerik:RadMenuItem Text="Open Window 2" Value="Window2" />
            </Items>
        </telerik:RadMenu>
    </div>
 
    <telerik:RadTextBox ID="txt1" runat="server" Width="400px">
    </telerik:RadTextBox>
    
    </form>
</body>
Simone
Top achievements
Rank 1
 answered on 17 Feb 2012
3 answers
141 views
Hello everybody,
I am using a grid with Server side selection as the same as Q1,2011 release demo(Grid/Selecting/Sever-Side Row Selection).
But I added this column to RadGrid to  have edit mode too.

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
<ItemStyle CssClass="MyImageButton" /> 
 </telerik:GridEditCommandColumn>

 

But when I click on edit ImageButton it dose not preserve the selected row states and all checkBox return to unchecked State.Is there any way to preserve the state in edit mode?

I tried to add eventHandler in ItemCreated  like this

 

 

if (e.Item is GridDataItem) 
{
e.Item.PreRender += 
new EventHandler(RadGrid1_ItemPreRender); 
}

 

and

   
private void RadGrid1_ItemPreRender(object sender, EventArgs e) 
{
((sender 
as GridDataItem)["CheckBoxTemplateColumn"].FindControl("CheckBox1") as CheckBox).Checked = (sender as GridDataItem).Selected; 
}

 but it didnt fire at edit time.

 Sincerely yours,
Bahram.
 

 

Richard
Top achievements
Rank 1
 answered on 17 Feb 2012
1 answer
128 views
Good morning,

I have on my RadGrid a RadComboBox Control

<telerik:RadComboBox runat="server" ID="comboBoxAddress" AllowCustomText="True" DataSourceID="objDataSourceAddress" EnableLoadOnDemand="True"
    Filter="Contains" DataTextField="FirstName" EmptyMessage="Suchen nach Adressen..."
    Width="289px" MaxHeight="100px">
</telerik:RadComboBox>

On that Cotnrol i set a DataSourceID

<asp:ObjectDataSource ID="objDataSourceAddress" runat="server" TypeName="Logic.AddressBll"
    SelectMethod="Select"></asp:ObjectDataSource>

Now the ComboBox works fine with, i see all the Addresses and i can search with the "Contains" Filter. My Question is now how can i work with the selected Items. For example i want to create a new recordset on my Grid, then i have to select an Address.
But for insert my Record i have to read the ID of the Address and then make my insert statement.

Regards


Kalina
Telerik team
 answered on 17 Feb 2012
9 answers
516 views
Hello people,

I use for my Webapplication the RadEditor for wiriting notes. This notes are saved in a database.
Since it is formatted text, I need the RTF string. So far I execute ExportToRtf() and I use the onExportContent-Event. In my event handler I manage to get the rtf-string with:
 protected void OnExportContentEvent( object sender,EditorExportingArgs e ) {         
        string rtf = e.ExportOutput; 
        SaveNote( rtf ); 
        ... 
    } 

This works just fine, except one problem. A dialog pops up asking to save the RTF-File. Is there a way to suppress this dialog?

Thank you for your help.
Rumen
Telerik team
 answered on 17 Feb 2012
9 answers
269 views
Hi,

This is the scenario:
I have a panel that enclose the whole page.
The page is long enough to show the scrollbar.
When you click on a combobox and the drop down list appears, try scrolling the page with the mouse wheel.
You'll notice the drop down list floats on the page when the list should just follow the location of the combobox.

Regards,
Dexter
Kalina
Telerik team
 answered on 17 Feb 2012
1 answer
159 views
While the skins that are supplied are pretty kewl, the colors are limited.  I was wondering if there is a place where users can upload their skins to share with the community.  I am not creative and don't want the responsibility for deciding what looks nice together.  I'd like any help I can get to make my site look more professional and interesting.
Thank you,
--Larry--
Bozhidar
Telerik team
 answered on 17 Feb 2012
1 answer
79 views
Hello Forumians!

Problem reflected in the attachment.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Parus.WebClient.WebForm1" %>
<%@ 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">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager" runat="server" />
    <div>
     <telerik:RadMenu ID="MainMenu" runat="server" />
    </div>
    </form>
</body>
</html>
cs
using System;
 
namespace Parus.WebClient
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());
            MainMenu.Items[0].Text = "MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());";
            MainMenu.Items[0].Items.Add(new Telerik.Web.UI.RadMenuItem());
            MainMenu.Items[0].Items[0].Text = "MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());";
 
            MainMenu.Items[0].Items.Add(new Telerik.Web.UI.RadMenuItem());
            MainMenu.Items[0].Items[1].Text = "MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());";
            MainMenu.Items[0].Items.Add(new Telerik.Web.UI.RadMenuItem());
            MainMenu.Items[0].Items[2].Text = "MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());";
            MainMenu.Items[0].Items.Add(new Telerik.Web.UI.RadMenuItem());
            MainMenu.Items[0].Items[3].Text = "MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());MainMenu.Items.Add(new Telerik.Web.UI.RadMenuItem());";
        }
    }
}
Kate
Telerik team
 answered on 17 Feb 2012
6 answers
189 views
Hi:
I need create a textbox into a gridcolumn, but it's dinamic in with c# code.
Thanks
David.
Han
Top achievements
Rank 1
 answered on 17 Feb 2012
2 answers
143 views
Hi,

When I load a page using the Office 2010 Blue skin if there is a radgrid and a radtreelist on it, they both use different text colours.  The grid uses the dark blue while the treelist uses black as the text colour.

I've had a quick look at other skins but they seem to use black on both.

Could these be aligned so that they match each other please?  

In the meantime I have used the following CSS to fix my issue.

.RadTreeList_Office2010Blue,
.RadTreeList_Office2010Blue .rtlHeader,
.RadTreeList_Office2010Blue .rtlHeader a
{
    color:#384e73 ! important;
}

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 17 Feb 2012
3 answers
187 views
Hi. I'm experiencing some display problems using a Scheduler control on an intranet page. In IE8, there's a 7px gap between the scheduler header and the table that contains the main scheduler appointment information (see screenshot 1). In Firefox 3.6, the same table is shifted around 90px right (see screenshot 2).

Using IE dev toolbar and Firebug, I've conclued the .rsContent div is positioned OK and that the problems arise with the child table being shifted down or right. I know the issue is being caused by global CSS rules in the intranet page style sheet interfering with the scheduler CSS settings but I'm really struggling to find out what's being overidden and causing the problems.

Is there any way I can insulate the Scheduler control from outside CSS 'interfernce' by wrapping it in a div with specific settings?
Regards, Ian
Jani
Top achievements
Rank 1
 answered on 17 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?