Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
47 views
Hi,
  I'm using telerick Q2version2010 rad controls. My requirement is, In .aspx page  display pencil image only. when I click on pencil image radeditor  window open. previously when I'm using Q2version2008 radcontrol, I display pencil image and click on this image open radeditor as a editible mode. but when I working on new radcontrols(Q2version2010) .  I didn't find how to display pencil (only) image . please give me suggestion how to achieve my requirement.

Advance in Thanks

Thanks
Mr.Perfect
Rumen
Telerik team
 answered on 04 Feb 2011
3 answers
70 views
Hey!

Yesterday I started to research Tooltip's features and definatelly this control is awesome.

I have looked all available tutorials http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx
And got just a quick question :
<telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position="Center"
    RelativeTo="Element" Width="400px" Height="200px" Animation="Resize" HideEvent="LeaveTargetAndToolTip"
    Skin="Default" OnAjaxUpdate="OnAjaxUpdate" OnClientHide="OnClientHide" EnableShadow="true"
    RenderInPageRoot="true" AnimationDuration="200">
</telerik:RadToolTipManager>
Here is RadTooltipManager, but where are <TargetControl> section. I just do not get where did you specified that tooltip should appear on these webControls. :)

Thank you!
Svetlina Anati
Telerik team
 answered on 04 Feb 2011
5 answers
87 views
I define OnClientPageLoad, and setup a simple alert function...but the thing never gets called??

It's a standard telerik:RadWindow with a ContentTemplate definition...
Svetlina Anati
Telerik team
 answered on 04 Feb 2011
13 answers
432 views
This is probably simple but I'm not seeing why this won't work. I have  button on a form declared as:
<asp:button ID="CancelButton" runat="server" OnClick="CancelButton_Click" Text="Cancel" CssClass="btnNormal" OnClientClick="CancelTrainingSessionDialog(this); return false;"/>  
 
 
At the top of the content control, I have this:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
            </telerik:RadWindowManager> 
<telerik:RadCodeBlock ID="JavascriptRadCodeBlock" runat="server">  
 <script type="text/javascript">  
     var cancelMessage = "Are you sure";  
     var cancelTitle = "Cancel Title";  
     function CancelTrainingSessionDialog(cancelButton) {  
         radconfirm(cancelMessage, CancelTrainingSessionCallback);  
     }  
 
     function CancelTrainingSessionCallback(arg, cancelButton) {  
         if (arg == true) {              
             document.getElementById("CancelButton").click();     
         }  
     }  
       
 
      
 
    
 </script> 
</telerik:RadCodeBlock> 

Basically, I want the button to display the confirm and if the result is true, then I would like to process the code behind for the cancel button.
However, when I run this, and click OK in the confirmation dialog box, I get "Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object".

Any ideas on how to resolve this?
Thanks,
Dennis
Andrew
Top achievements
Rank 1
Veteran
Iron
 answered on 04 Feb 2011
1 answer
64 views
I have a grid and I select an item clientside after binding. I wish to scroll to the selected item. The documentation I have found on the telerik site references row.Control.scrollIntoView which is not (or is no longer) a valid construct.
Vasil
Telerik team
 answered on 04 Feb 2011
1 answer
154 views
I have been using the RadFileExplorer and have been getting on great with it, its a fantastic control. One thing I'm trying to do is add a lot of custom menu items. I have followed code examples on here to achieve this and it all all appears to work well apart from the menu in the tree view. if i right click an item the code uses the node currently selected, not the node i clicked, therefore I have to click the node I want before right clicking it again for the context menu to achieve the results I want, I've looked through the Documentation available online for both the file explorer and tree view but cannot see the client side code to achieve what I want, below is the client side code I currently use, any solution would be greatly appreciated!

function treeContextMenuClicked(toolbar, args) {
        var buttonValue = args.get_menuItem().get_value();
        var fileExplorer = $find("<% = rfeFilesAndFolders.ClientID %>");
        var treeView = fileExplorer.get_tree();
        var fID = treeView.get_selectedNode().get_attributes().getAttribute("FolderId");
        var fType = treeView.get_selectedNode().get_attributes().getAttribute("FolderType");
        var msg = fID + " " + fType
        var isSilverlight = 1;
         
        if (buttonValue == "share" && fType == 2) {
            var sURL = '<%=session("webbase") %>Share/' + fID + '/Add'
            var owindow = radopen(sURL, null);
            owindow.SetTitle('Share Object');
            owindow.SetSize(530, 360);
            owindow.Center();
            return false;
        }
Dobromir
Telerik team
 answered on 04 Feb 2011
1 answer
153 views
HI All,

I am facing some issues while rad window closing process. Please find my requirement below....

i have one rad grid which is using to export excel file to DB. and i am using superate aspx page to open this as for window.now i want ot know how can i close widow after completing the uploading process.i want to know that my code is in C# Code behind.
here is my code:
distribute.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DistributeDialog.aspx.cs"
    Inherits="DistributeDialog" %>

<%@ 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>Distribute Activation Codes</title>
    <link href="~/style/styles.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../style/Authentication.css" />
    <link href="~/style/styles.css" rel="stylesheet" type="text/css" />

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>

    <style type="text/css">
        html, body, form
        {
            padding: 0;
            margin: 0;
            height: 100%;
            background: #f2f2de;
        }
        body
        {
            font: normal 11px Arial, Verdana, Sans-serif;
        }
        fieldset
        {
            height: 200px;
        }
        * + html fieldset
        {
            height: 168px;
            width: 268px;
        }
    </style>
</head>
<body>
    <form id="formDistributeDialog" method="post" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server"
        Skin="Sunset" />

    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }


        //fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layout
        function ChromeSafariFix(oWindow) {
            var iframe = oWindow.get_contentFrame();
            var body = iframe.contentWindow.document.body;

            setTimeout(function() {
                var height = body.scrollHeight;
                var width = body.scrollWidth;

                var iframeBounds = $telerik.getBounds(iframe);
                var heightDelta = height - iframeBounds.height;
                var widthDelta = width - iframeBounds.width;

                if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta);
                if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta);
                oWindow.center();
            }, 310);
        }
        

    </script>

    <div style="width: 268px; height: 193px;">
        <br />
        <br />
        <asp:Label ID="lblUpload" runat="server" Text="File upload:"></asp:Label>
        <asp:FileUpload ID="FlUpload" runat="server" /><%--<asp:Image ID="imgDownloadInfo" runat="server"
                ImageUrl="~/Images/Help.png" />--%>
        <asp:Label runat="server" CssClass="lbl_errormsg_visible" Text="" ID="lblGenerationCodes"
            Visible="false"></asp:Label>
        <asp:RequiredFieldValidator ID="rfvUpload" Display="Dynamic" ControlToValidate="FlUpload"
            ErrorMessage="Please select file!" Font-Names="Arial" Font-Size="11" runat="server"
            ValidationGroup="update">
        </asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="revFileUpLoadValidator" runat="server" ErrorMessage="Only (xls) allowed "
            ValidationExpression="(.*\.xlsx)|(.*\.xls)" Display="Dynamic" ControlToValidate="FlUpload"
            ValidationGroup="update">
        </asp:RegularExpressionValidator>
        <div style="margin: 20px 0 0 0;">
            <div style="float: left; margin: 6px 0 0 18px;">
                <asp:CheckBox ID="chkSendMail" runat="server" Text="Send emails to users" />
            </div>
        </div>
        <div style="margin-top: 4px; text-align: right;">
            <asp:Button ID="btnUpdate" runat="server" Text="Bulk Distribute" ValidationGroup="update"
                OnClick="ExportExcelToSQL_onclik" />
            <%--<input type="button" value="Cancel" onclick="" />--%>
        </div>
        <asp:TextBox ID="txtCompID" runat="server" Style="display: none;"></asp:TextBox>
    </div>
    </form>
</body>
</html>

Distribute.aspx.cs:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml;
using System.Net;
using System.IO;
using Microsoft.Office.Interop;
using Microsoft.Office.Interop.Excel;
using System.Reflection;
using System.Text;

public partial class DistributeDialog : System.Web.UI.Page
{
    System.Data.DataTable dt = new System.Data.DataTable("dtExcel");
    protected void Page_Load(object sender, EventArgs e)
    {
        string url = HttpContext.Current.Request.RawUrl;
        if (CommonSession.CurrentUserId == null)
        {
            Response.Redirect("~\\Login\\Login.aspx");
        }
        else
        {
            if (url.IndexOf("?") == -1)
            {
                Response.Redirect("~\\Login\\login.aspx");
            }
            else
            {
                if (CommonSession.CurrentUserRole == "Superadmin")
                {
                   txtCompID.Text = Request.QueryString["companyID"].ToString();
                }
                else
                {
                    txtCompID.Text = CommonSession.CurrentUserCompanyId.ToString();
                }
            }
        }
    }
    protected void ExportExcelToSQL_onclik(object sender, EventArgs e)
    {
           try
            {
                formDistributeDialog.Disabled = true;
                lblGenerationCodes.Visible = false;
                string SendmailToUsers;
                File.Delete(Server.MapPath(@"~\Forms\TempFileUpload\") + FlUpload.FileName);
                string Filename = Server.MapPath(@"~\Forms\TempFileUpload\") + FlUpload.FileName;
                FlUpload.SaveAs(Filename);

                    string Ext = FlUpload.FileName.Substring(FlUpload.FileName.LastIndexOf(".") + 1);
                    string SheetName = FlUpload.FileName;
                    SheetName = SheetName.Replace(".xlsx", "");
                    SheetName = SheetName.Replace(".xls", "");
                    string ExceCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + Filename + "; Extended Properties=Excel 8.0";                    
                    System.Data.OleDb.OleDbConnection excelConnection = new System.Data.OleDb.OleDbConnection(ExceCon);
                    excelConnection.Open();       
                    string OleStr = "SELECT * INTO [ODBC; " + ConfigurationManager.AppSettings["AONConnectionString"].ToString() + " ].[" + SheetName + "]   FROM [" + SheetName + "$]\"";
                    System.Data.OleDb.OleDbCommand excelCommand = new System.Data.OleDb.OleDbCommand(OleStr, excelConnection);
                    excelCommand.ExecuteNonQuery();
                    excelConnection.Close();
                    WebClient webClient = new WebClient();

                    if (chkSendMail.Checked == true)
                    {
                        SendmailToUsers = "true";
                    }
                    else
                    {
                        SendmailToUsers = "false";
                    }
                    string overview = webClient.DownloadString(string.Concat(ConfigurationManager.AppSettings["AONServiceURL"].ToString(), "/UpdateActivationCodeInfoResult/", SheetName, "/", SendmailToUsers,"/", CommonSession.CurrentUserId.ToString(), "/", CommonSession.CurrentUserCompanyId.ToString()));
                    File.Delete(Server.MapPath(@"~\Forms\TempFileUpload\") + FlUpload.FileName);
                    if (chkSendMail.Checked == true)
                    {
                        lblGenerationCodes.Text = "File Uploaded Successfully & Mails Sent Successfully ";
                        lblGenerationCodes.Visible = true;
                    }
                    else
                    {
                        lblGenerationCodes.Text = "File Uploaded Successfully";
                        lblGenerationCodes.Visible = true;
                        
                    }
                    GetRadWindowCloseScript();
                    
            }
            catch (Exception ex)
            {
                lblGenerationCodes.Text = ex.Message;
                lblGenerationCodes.Visible = true;
                formDistributeDialog.Disabled = false;               
            }
          

        
    }
    public static string GetRadWindowCloseScript()
    {
        return @"
            <script type='text/javascript'>
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if(window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                var currentWindow = oWindow;
                currentWindow.Close();
            </script>";
    }  
   
}
I am trying to accesing this as rad widow.fid that code in below;

 <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" Skin="Office2007" EnableShadow="true">
        <Windows>
                 <telerik:RadWindow ID="DistributeWindow" Height="250px" Width="400px" Modal="true"
                runat="server" Behaviors="Close" NavigateUrl="~/Forms/DistributeDialog.aspx"
                OnClientClose="reBindCompanyOverviewPage">
            </telerik:RadWindow>
           
        </Windows>
    </telerik:RadWindowManager>

now i want to close these windows after completion of  My Export process.

PLease do me need full as soon as posible.
Georgi Tunev
Telerik team
 answered on 04 Feb 2011
1 answer
35 views
Hi,

I am using Telerik_AJAX_controls_2010_3_1215_for_SharePoint_2010_Trial with Sharepoint Foundation 2010 and Windows 7 64 bit environment.  I have enabled RadEditor features under my solutions and when I save/insert a picture in a Rich Text Field(Note Field with RichTextmode="FullHtml)  the image is not saving on that field. what is the issue?
The field is as follows:

<Field Type="Note"  NumLines="5"  ID="GUID"   Name="MyField"  RichTextMode="FullHtml"/>


Any help would be greatly appreciated.

Thanks and Regards,
Bharat Pandey
Stanimir
Telerik team
 answered on 04 Feb 2011
3 answers
275 views
Hi
I have a RadGrid in my form.
There is data displayed for visitors from Visitors table.
I want the data to be displayed in descending order, so that the latest visitor filled via a form should be seen first in the grid.

Any dvice is helpfull.
Thanks
Sucheta
Sucheta Patil
Top achievements
Rank 1
 answered on 04 Feb 2011
1 answer
91 views
Hi,

I am using the 'Telerik' skin on buttons only. The issue i am having is in Firefox (3.6.6) the button text is vertically aligned to the bottom of the button. I have downloaded the latest version of Telerik & have also added a .net button to a blank web form (so no css etc ..) but still no joy! The button text is fine in all browsers, any ideas ?

I have tested the Form Decorator examples page (http://demos.telerik.com/aspnet-ajax/formdecorator/examples/default/defaultcs.aspx) & the 'Submit Form' button on this page renders fine.

Cheers

Luke
Georgi Tunev
Telerik team
 answered on 04 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?