Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
220 views
Hi,

I am trying to fix the widht and height of the image chosen in telerik RadEditior, i have tried with both Javascript and C# code saperately which i found in forums, but could not resolve.
I am using V.S 2010 and telerik product version 2009.3.1103.35.

Javascript used:

 

 

<script type="text/javascript">  

 

function OnClientLoad(editor, args) {  

editor.attachEventHandler( 

"oncontrolselect", function () {  

//Check if image  

window.setTimeout(

function () {  

var selElem = editor.getSelection().getParentElement();  

alert(selElem.tagName); 

if (selElem.tagName == "IMG") {  

//Store current width and height  

curWidth = selElem.offsetWidth;

curHeight = selElem.offsetHeight; 

//Possible to resize, so attach eventhandler  

selElem.onresizeend = 

function (e) {  

alert("I was resized");  

selElem.style.width = "150";  

selElem.style.height ="150"

selElem.onresizeend = null; //remove handler  

 

//Make calculations about skaling, then re-size image  

};

}

}, 0);

});

}
Code used in C#

The one which i have found in these attachements,
In page_load
{ string [] paths = new string[] { "~/Images/editor" };

 

RadEditor1.ImageManager.ViewPaths = paths;

RadEditor1.ImageManager.UploadPaths = paths;

RadEditor1.ImageManager.DeletePaths = paths;

RadEditor1.ImageManager.ContentProviderTypeName =

 

typeof(ChangeImageSizeProvider).AssemblyQualifiedName;
}

 public class ChangeImageSizeProvider : Telerik.Web.UI.Widgets.FileSystemContentProvider 

public ChangeImageSizeProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag) 

base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)  

{  

public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)

 {
System.Drawing.Image image = System.Drawing.Image.FromStream(file.InputStream);  

string physicalPath = Context.Server.MapPath(path); 
 int newWidth = 100;// Fixed width 
 int newHeight = 100;// Fixed height  

System.Drawing.Image resultImage = ResizeImage(image, new Size(newWidth, newHeight));

 resultImage.Save(physicalPath + name); 

string result = path + name; 
 return result;  

}

 

private System.Drawing.Image ResizeImage(System.Drawing.Image sourceImage, Size newSize)  

Bitmap bitmap = new Bitmap(newSize.Width, newSize.Height); 
 Graphics g = Graphics.FromImage((System.Drawing.Image)bitmap);

g.InterpolationMode = InterpolationMode.HighQualityBicubic;  

g.DrawImage(sourceImage, 0, 0, newSize.Width, newSize.Height);

g.Dispose();

 return (System.Drawing.Image)bitmap;  

}

}

 

 I have a save option with which i am saving 

 

 asdf.Content = this.RadEditor1.Content;

 asdf.save();

Please let me know, if I need to do anything else.

Thanks
G Krishna

Rumen
Telerik team
 answered on 05 Jul 2011
1 answer
51 views
I have a simple page with a toolbar on the masterpage and a treeview in the content page

I'm getting this error in firebug when paging, and doing random things like sorting

<%@ Page Title="" Language="C#" MasterPageFile="~/App_Master/Medportal.master" AutoEventWireup="true" CodeBehind="TreeList.aspx.cs" Inherits="Medportal.Skins.Medportal.Controls.TreeList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <telerik:RadTreeList runat="server" DataKeyNames="locationID"
        DataSourceID="locationsDS" ParentDataKeyNames="parentID"
        AllowMultiColumnSorting="True" AllowPaging="True" AllowSorting="True"
        PageSize="15" ShowFooter="True" >
        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
    </telerik:RadTreeList>
 
    <asp:SqlDataSource ID="locationsDS" runat="server"
        ConnectionString="<%$ ConnectionStrings:authdbConnectionString %>"
        SelectCommand="SELECT [locationID], [locationName], [parentID], [shortcode], [isTest], [addressID] FROM [common_location] ORDER BY [locationName]" />
</asp:Content>

Any idea?
Mira
Telerik team
 answered on 05 Jul 2011
3 answers
142 views
i want to increase the weight of telerik menu , i wan to make its heights similar as telerik offical website's menu 
but i am unable to do so .
if height increase by increasing items height or generally increasing the height of menu bar from properties , the rollover gets distorted ,and also the looks ,last i was trying the below 
<div style="width: 1130px; height:auto; position: relative; richness:100; top: 0px; left: 95px; color: #EEF1CD; background-color: #F7FAFE">
            <telerik:RadMenu ID="RadMenu1" runat="server" Skin="Vista" Width="1130px"
                EnableRoundedCorners="True" style="top: 0px; left: 0px; "
                Font-Size="Large" Height="50px" BackColor="White"
                  >
                <Items>
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1" width ="200" >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem2" width ="200"  >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem3" width ="200"  >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem4" width ="200"  >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem runat="server" Text="Root RadMenuItem5" width ="200"  >
                    </telerik:RadMenuItem>
                </Items>
                 
            </telerik:RadMenu>
        </div>
Kate
Telerik team
 answered on 05 Jul 2011
2 answers
128 views
We have a window with a RadGrid with a footer.  When the window opens, the footer displays correctly at the bottom of the grid.  The window contains several buttons that cause a script to be registered that executes window.showModalDialog() to display a popup window.  When the popup opens, the footer disappears (although it is still in the rendered html).  When the user closes the popup, the footer reappears.

Looking at the html, I see that the grid is rendered as a div with a height of 190px.  This div contains a div for the header, a div for the main area of the grid, and a grid for the footer.  The header and footer divs do not specify a height but the middle div specifies a height of 300px.  Somewhere this is being converted to 122px, leaving room for the header and footer.  Apparently whatever adjusts the height is not being called when the window is refreshed after the user clicks on one of the buttons.  As a result, the middle div retains a height of 300px and the footer does not appear.

Is there a workaround for this?

Thanks,
Stephen
Pavlina
Telerik team
 answered on 05 Jul 2011
1 answer
331 views
Dear Telerik team -- We recently purchased Telerik controls to use it in SharePoint 2010 application page. I tried to register Telerik.Web.UI as a safe control in the web.config:
------------------------------------------------------------------------------
    <SafeControls>
      <SafeControl Assembly="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="False" />
      <SafeControl Assembly="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.HtmlControls" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="False" />
.
.
.
.
      <SafeControl Assembly="Telerik.Web.UI, Version=2011.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" Typename="*" />
    </SafeControls>
------------------------------------------------------------------------------

and got this error:


Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: This page has encountered a critical error. Contact your system administrator if this problem persists.

Source Error:

Line 3:  <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
Line 4:  <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Line 5:  <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
Line 6:  <%@ Register TagPrefix="wssuc" TagName="MUISelector" src="~/_controltemplates/MUISelector.ascx" %>
Line 7:  <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>

Source File: /my/personal/CSharpBooks/_catalogs/masterpage/v4.master    Line: 5


Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955


Please, advise!

Sincerely. Vladimir Pavlov.
Rumen
Telerik team
 answered on 05 Jul 2011
1 answer
106 views
Hello,


I'm using Telerik 8.0.0.6 and RadAsyncUpload in a RadGrid to permit users to upload a file for each line (indicating documents to send).When i upload the first document, all is good, but when i select the second, i have an error indicating the file has not been found (In my code behind, i do only "SaveAs()"). When i look at the errors, I can see that the second file is the same as the first (s2ghv0sb.kka)
Each time it's the same fileName for each upload.


How can I specify a different name?


Thank you in advance.
Peter Filipov
Telerik team
 answered on 05 Jul 2011
11 answers
175 views
I recently updated to SP2 (version 2008.2.1001) and found that all of the RadDatePickers in my application stopped working. When I click on a date, the page posts back to the webroot (rather than just filling the dat into the textbox). I have a lot of  datepicker controls in this app and it happens on all of them. When I copy the previous version DLLs back into the bin directory, everything works again, so it must be newly introduced in this version.

Looking at the version history notes, I saw this:
Removed onclick="return false;" attribute from calendar cells

This seems to be likely what is causing this problem. Is there something I need to restore the functionality?

Thanks,
John
Pyron Technologies
Sebastian
Telerik team
 answered on 05 Jul 2011
2 answers
205 views
Dear All,

Here is my scenario, I am opening a Radwindow from my Parentpage. I have a button on my parentpage which I am using to save some data,  when I click on the button the radwindow disappears its destroyed. Please let me know how can I rectify this issue. Please note that I don't want to cancel the postback of my button which is on the ParentPage as i need to save some data on the button click and also I don't want to make the Radwindow as modal window. Can I capture the parentpage button event on my radwindow page. Any help is appreciated.

Regards,
Noor hussain.
Noor hussain
Top achievements
Rank 1
 answered on 05 Jul 2011
1 answer
77 views
We use the RadInputManager to a validate TextBox. When validation fails an error message is displayed in the textbox. When i enter the TextBox to correct the error the TextBox is empty!

Below the code:
<telerik:RegExpTextBoxSetting BehaviorID="RegExpTextBoxSetting3" IsRequiredFields="true" Validation-IsRequired="true"
 ValidationExpression="^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$">
     <%--Must be at least 10 characters
     Must contain at least one one lower case letter, one upper case letter, one digit and one special character
     Valid special characters (which are configurable) are -   @#$%^&+=--%>
     <TargetControls>
         <telerik:TargetInput ControlID="tbPassword" />
     </TargetControls>
 </telerik:RegExpTextBoxSetting>
<asp:TextBox ID="tbPassword" runat="server" CssClass="FormTextBox"></asp:TextBox>

What is going wrong here?

Regards,
Dick van Straaten
Iana Tsolova
Telerik team
 answered on 05 Jul 2011
1 answer
151 views
Hi,
I have created the user control ASP.net application, treelist was added as one of the control in user control page. In the main page i have added this user control at runtime. i.e based on the records return from the database i am try to create a new instance of user control and adding to main page. i was able to show the different tree list on the screen. But when i try to expand and collape the cutome added user control it was not working. ie. When i expand the tree list it is working fine. But when i click the collapse icon. it is still in expand state.

Is there any way that we can custome the expand and collapse event of the Tree list.
Mira
Telerik team
 answered on 05 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?