Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
152 views
Hi

I am generating RadTreeView dynamically, please find the code snippet below:-

Telerik.Web.UI.RadTreeView ReportTree = new Telerik.Web.UI.RadTreeView();
ReportTree.ID = "rptTree" + i;
ReportTree.Height = 400;
ReportTree.Nodes.Clear();
ReportTree.Skin = "Telerik";
ReportTree.EnableDragAndDrop = true;

SqlCommand rscommand_Child = new SqlCommand(myquery, myconnection);
DataTable dtt = new DataTable();
SqlDataAdapter daa = new SqlDataAdapter(rscommand_Child);
daa.Fill(dtt);

for (int ii = 0; ii < dtt.Rows.Count; ii++)
{
Telerik.Web.UI.RadTreeNode tr = new Telerik.Web.UI.RadTreeNode();
tr.Text = "" + dtt.Rows[ii][1].ToString() + "";
ReportTree.Nodes.Add(tr);
}
ReportTree.OnClientNodeDragging = "openDashboards";


Somehow openDashboards in not executing. openDashboards code snippet:-

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function openDashboards(source, dest, e)
        {
                var oManager = GetRadWindowManager();
                //get the clicked node
                var Url = eventArgs.get_node(sender, eventArgs).get_value();
                window.alert("1");
                //get the active RadWindow
                var oWnd = GetRadWindowManager().getActiveWindow();
                //now we need to open a new RadWindow and ensure that
                //such RadWindow has not been already opened.
                var windows = oManager.get_windows();
                for (var i=0; i < windows.length; i++)
                   {
                       var wnd = windows[i];
                       //check if an already created window has that Url
                       if (wnd.get_navigateUrl() == Url)
                       {
                           //if so - activate that window
                           wnd.setActive(true);
                           return;
                       }
                   }
                //else open a new window
                radopen(Url,null);
        }
        </script>
    </telerik:RadCodeBlock>


<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleOnPageLoad="false"
                    VisibleTitlebar="true" VisibleStatusbar="false"
                     ReloadOnShow ="true" ShowContentDuringLoad="true" RestrictionZoneID="dropDiv" Skin="Telerik">
</telerik:RadWindowManager>

Can somebody help where I am going wrong?

Thanks!!!
Arindam














Atanas Korchev
Telerik team
 answered on 25 Mar 2009
2 answers
134 views
Hi,
My requirement is to print the radGrid data only and my grid is having horizontal scroll bar. I am using following script to print

function CallPrint(strid)
    {
     var prtContent = document.getElementById(strid);
     var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
     WinPrint.document.write(prtContent.innerHTML);
     WinPrint.document.close();
     WinPrint.focus();
     WinPrint.print();
     WinPrint.close();
     prtContent.innerHTML=strOldOne;
     return false;
    }

and on print button client click I am calling the following function

OnClientClick="javascript:return CallPrint('printGrid');"

where printGrid is Div id which contains the grid.

Now my problem is I am able to print only that data which I can see initially (not scrolling) on browser.
I am unable to print the whole data .

what might be the solution for this, is radgrid is having any print functionality ?

Thanks,




Ram
Top achievements
Rank 1
 answered on 25 Mar 2009
4 answers
327 views
Hi,

I'm having a wierd issue with databinding my treeview control on page_init event. Basically on the first load of the control it's not visible--non of its nodes are rendedered. Any subsequent requests to the same page though and the control appears and functions normally. This isn't a problem when loading the control on page_load although i need to do it in page_init for page life cycle and viewstate reasons.

Any insight into this?

Thanks,
Vandara Peou
Vandara Peou
Top achievements
Rank 1
 answered on 25 Mar 2009
7 answers
263 views
Dear sir,
             I have create one aspx page. The page name is Home.aspx. But i am not create dock at runtime already i created my design page.Now i have 9 dockcontrol in my page.if user has change the dock control at runtime it was maintain state after that he will come back same state maintain any machine.Please help me sir....

Thanks and regards

Raja


I have upload my aspx page and aspx.cs page in this mail.

aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" %>

<%@ Register Src="uclContent.ascx" TagName="uclContent" TagPrefix="uc1" %>
<%@ Register Src="uclEmail.ascx" TagName="uclEmail" TagPrefix="uc2" %>
<%@ Register Src="uclTimedate.ascx" TagName="uclTimedate" TagPrefix="uc3" %>
<%@ Register Src="uclAnnouncement.ascx" TagName="uclAnnouncement" TagPrefix="uc4" %>
<%@ Register Src="uclCustomerservice.ascx" TagName="uclCustomerservice" TagPrefix="uc5" %>
<%@ Register Src="uclWeather.ascx" TagName="uclWeather" TagPrefix="uc6" %>
<%@ Register Src="uclLinks.ascx" TagName="uclLinks" TagPrefix="uc7" %>
<%@ Register Src="uclNews.ascx" TagName="uclNews" TagPrefix="uc8" %>
<%@ Register Src="uclTechnicalsupport.ascx" TagName="uclTechnicalsupport" TagPrefix="uc9" %>
<%@ 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>Home.........:::</title>
</head>

<script type="text/javascript">
function frmsubmit()
{
    document.form1.submit();
    window.close();     
        
}
window.onunload = function()
{
        document.forms['frmHome'].submit();        
        window.close();        
}

</script>

<body>
    <form id="frmHome" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            &nbsp;</div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server" EnableViewState="false"
            OnLoadDockLayout="RadDockLayout1_LoadDockLayout" OnSaveDockLayout="RadDockLayout1_SaveDockLayout"
            StoreLayoutInViewState="false">
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td style="width: 100px">
                        <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="800px" Width="380px">
                            <telerik:RadDock ID="RadDock1" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc1:uclContent ID="UclContent1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock4" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc4:uclAnnouncement ID="UclAnnouncement1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock7" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc7:uclLinks ID="UclLinks1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                        </telerik:RadDockZone>
                    </td>
                    <td style="width: 100px">
                        <telerik:RadDockZone ID="RadDockZone2" runat="server" Height="800px" Width="300px">
                            <telerik:RadDock ID="RadDock2" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc2:uclEmail ID="UclEmail1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock5" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc5:uclCustomerservice ID="UclCustomerservice1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock8" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc8:uclNews ID="UclNews1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                        </telerik:RadDockZone>
                    </td>
                    <td style="width: 100px">
                        <telerik:RadDockZone ID="RadDockZone3" runat="server" Height="800px" Width="300px">
                            <telerik:RadDock ID="RadDock3" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc3:uclTimedate ID="UclTimedate1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock6" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc6:uclWeather ID="UclWeather1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                            <telerik:RadDock ID="RadDock9" runat="server" Width="300px" DockHandle="Grip">
                                <ContentTemplate>
                                    <uc9:uclTechnicalsupport ID="UclTechnicalsupport1" runat="server" />
                                </ContentTemplate>
                            </telerik:RadDock>
                        </telerik:RadDockZone>
                    </td>
                </tr>
            </table>
        </telerik:RadDockLayout>
    </form>
</body>
</html>


aspx.cs.page

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

public partial class Home : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //Response.Write("<script language=javascript>alert('Yes')</script>");            
        }
    }
    protected void Page_Unload(object sender, EventArgs e)
    {

        //form1.Attributes.Add("onunload", "<script language=javascript>alert('Yes')</script>");
    }
   
    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
    {
        // Store the positions in a cookie. Note, that if there are lots of dock objects on the page
        // the cookie length might become insufficient. In this case it would be better to use the
        // cookie to store a key from a database, where the positions will be actually stored.
        //
        // You can store the positions directly in a database and use the ID of the currently logged
        // user as a key to his personalized positions.
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        string serializedPositions = serializer.Serialize(e.Positions);
        string serializedIndices = serializer.Serialize(e.Indices);

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

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

    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
    {
        HttpCookie positionsCookie = Request.Cookies["DockLayout"];
        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 ButtonAddDock_Click(object sender, EventArgs e)
    {

    }
    protected void lnkSave_Click(object sender, EventArgs e)
    {

    }
}





Raja
Top achievements
Rank 1
 answered on 25 Mar 2009
1 answer
92 views
Hello,

I am using Q3 2008.

I have one problem for scheduler,  suppose 2 events having duration of 2 weeks  , and another event suppose 3 days which starts in middle of week. on this scenario  i am not able to see third event nor more link for same.

check image visit

Please help me to solve my problem.

Thanks,
Amol
Peter
Telerik team
 answered on 25 Mar 2009
2 answers
190 views
Trying to log out with a button click on the tool bar called LogOut and use a confirmation notice.  Here is my code which is on my masterpage.  when I click on the button, it logs out but does not give the confirmation.

<telerik:RadToolBar ID="RadToolBar1" AutoPostBack="true" Runat="server"   
        onbuttonclick="RadToolBar1_ButtonClick">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            <Items> 
                <telerik:RadToolBarButton runat="server" NavigateUrl="~/default.aspx"   
                    Target="_parent" Text="Requirements">  
                </telerik:RadToolBarButton> 
                <telerik:RadToolBarButton runat="server"   
                    NavigateUrl="http://cjis4/Reports/Pages/Report.aspx?ItemPath=%2fCIJS%2fRequirements"   
                    Target="_blank" Text="Report">  
                </telerik:RadToolBarButton> 
                <telerik:RadToolBarButton runat="server" NavigateUrl="~/Audit.aspx"   
                    Target="_parent" Text="Audit">  
                </telerik:RadToolBarButton> 
                <telerik:RadToolBarButton runat="server" NavigateUrl="~/Deleted.aspx"   
                    Target="_parent" Text="Deleted">  
                </telerik:RadToolBarButton> 
                <telerik:RadToolBarButton runat="server" NavigateUrl="~/change.aspx"   
                    Target="_parent" Text="Change Password">  
                </telerik:RadToolBarButton> 
                <telerik:RadToolBarButton Text="Log Out" CommandName="LogOut">  
                </telerik:RadToolBarButton>                  
            </Items> 
        </telerik:RadToolBar> 
           
         <script type="text/javascript">  
             function clientbuttonclick(sender, args) {  
 
                 var button = args.get_item();  
                 if (button.get_commandName() == "LogOut") {  
                     args.set_cancel(!confirm('Log Out?'));  
                 }  
             }        
 </script>   

My code behind looks like this:

protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e)
    {
        FormsAuthentication.SignOut();
        FormsAuthentication.RedirectToLoginPage();
    }

derek
Top achievements
Rank 2
 answered on 25 Mar 2009
2 answers
139 views
I have the latest development build (2009.1.311.35).  I have a grid control that I dynamically change the datasource to.  If I change the datasource to a method that returns more results then everything seems to work great, but then when I change to a datasource with less results then number of items and pages that are available to select from are still reflecting the old datasource.

* Note with one of the datasources I have implemented custom paging. 

Rick
Richard
Top achievements
Rank 1
 answered on 25 Mar 2009
3 answers
90 views
Was thinking of implementing a toolbar/menu like the one at the bottom of the FaceBook "home page" (when you're logged in.)  Was thinking of adapting the RadToolbar - has anyone tried anything similar?  Any luck creating "alert" style dialogs like those on FaceBook?
Atanas Korchev
Telerik team
 answered on 25 Mar 2009
13 answers
200 views

How to prevent OnClientAppointmentClick event happening as part of OnClientAppointmentResizeEnd event? When I handle the OnClientAppointmentResizeEnd I do not want the OnClientAppointmentClick to fire.

Peter
Telerik team
 answered on 25 Mar 2009
1 answer
109 views
Hello,
I have a Big sitemap  that results (by radmenu) in a 40 Kbytes output code in every page, because it has all the links inside.
My functionality is , you press a link, the new page appears and the submenus (if any) are collapsing, so I don't really need all the links in every page.
I wonder if there are any techniques to minimize the ouput code .

Also, I  was wondering, that, since the menu is rather stable, to copy-paste the output code  to an html file and include it (as an external html file) in my pages.
Is this feasible?
Any other suggestions?

Thank you
Atanas Korchev
Telerik team
 answered on 25 Mar 2009
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?