Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
107 views
I use Form decorator in a page. And there is also FileUpload in same page.
But in IE7 FileUpload is seen very badly, even FileUpload's textbox isn't seen.

Form decorator's DecoratedControls="Textbox, Buttons, Select"

In Firefox there is no problem.
What am I doing wrong ?

 

Murat Co
Top achievements
Rank 1
 answered on 06 Aug 2009
1 answer
105 views
I have a grid with template columns.I am trying to add new rows using the following client side code.

var

tableView = $find("<%= MedicationGrid.ClientID %>").get_masterTableView();

 

tableView.set_dataSource(result);

tableView.dataBind();

 

 

var grid = $find("<%= MedicationGrid.ClientID %>");

 

grid.repaint();

When I am debugging, I am able to see the newly added record in the result object, But it is not displaying the newly added row in the grid.In place it is displaying a blank row.When I am clicking on edit button on any of the gridrow it is displaying the record in the grid as I have stored the data in the session.

Am I doing anything wrong ?

Regards,
Arabinda

Yavor
Telerik team
 answered on 06 Aug 2009
1 answer
97 views
I'm using the Q1, 2009 distribution of the RadGrid.  I have a GridTemplateColumn that looks like so:

<radG:GridTemplateColumn UniqueName="Reg" HeaderText="Reg" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">
    <ItemStyle Width="60px" HorizontalAlign="Right" />
    <HeaderStyle Width="60px" />
    <ItemTemplate>
        <%# Eval("wk1_Regular", "{0:0.00}") %>
        <br />
        <%# Eval("wk2_Regular", "{0:0.00}")%>
    </ItemTemplate>
</radG:GridTemplateColumn>

What I want to occur is that when the user enters, say, 16 in to the filter text box, I want the grid be populated with rows where EITHER wk1_Regular OR wk2_Regular have the value 16.

No matter what I try, I cannot get filtering to work.  When I hit enter in the filter textbox, or click the Contains filter menu item, it initiates a call to the server, and fires the ItemCommand event, but the resultant data is never filtered.  Do you have an example of how this should be properly implemented?

Thanks.
Pavlina
Telerik team
 answered on 06 Aug 2009
1 answer
249 views

Hello,

I have a Radeditor which is used to edit HTML Newsletter templates. I have a button on whose click event i have to save the template in database(So later i could mail those templates), also i have to convert the html content to PDF format. I tried the below Pasted code, but the PDF i obtained is showing out to be blank.

Please refer the following code snippet:


ASPX Page:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="CreateNewsletter.aspx.cs" Inherits="_Default" %> 
 
<%@ 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">  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
   <title>Template 2 - Left Sidebar</title> 
    <link href="CSS/screen.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
    <form id="form1" runat="server" style="height: 100%">  
      
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        </telerik:RadScriptManager> 
          
        <telerik:RadEditor ID="Template_content" runat="server" Height="600px"   
            Width="100%" ContentFilters="MakeUrlsAbsolute" OnExportContent="Template_content_ExportContent">  
            <MediaManager ViewPaths="~/PDF/" UploadPaths="~/PDF/" /> 
        <ExportSettings OpenInNewWindow="true"></ExportSettings> 
        <Content> 
         
          
     
      
     <table style="background-color: #99cc00;" cellspacing="0" cellpadding="10" width="100%">  
            <tbody> 
                <tr> 
                    <td valign="top" align="center">  
                    <table cellspacing="0" cellpadding="0" width="600">  
                        <tbody> 
                            <tr> 
                                <td style="border-top: #000000 0px solid; border-bottom: #ffffff 1px solid; background-color: #ffcc66; text-align: center;" align="center"><span style="font-size: 10px; color: #996600; line-height: 200%; font-family: verdana; text-decoration: none;">Email not displaying correctly? <a href="*|ARCHIVE|*" style="font-size: 10px; color: #996600; line-height: 200%; font-family: verdana; text-decoration: none;">View it in your browser.</a></span></td> 
                            </tr> 
                            <tr> 
                                <td style="border-top: #333333 0px solid; border-bottom: #ffffff 10px solid; background-color: #ffffff;" valign="middle" align="left"><center><a href=""><img id="editableImg1" title="Your Company" style="border: 0px solid;   " alt="Your Company" src="img/logo_2column.jpg" /></a></center></td>  
                            </tr> 
                        </tbody> 
                    </table> 
                    <table style="background-color: #ffffff;" cellspacing="0" cellpadding="20" width="600">  
                        <tbody> 
                            <tr> 
                                <td style="border-right: #cccccc 1px dashed; width: 200px; background-color: #ffffff; text-align: left;" valign="top"><span style="font-weight: normal; font-size: 11px; color: #999999; line-height: 150%; font-family: arial;"><span style="font-weight: bold; font-size: 15px; color: #333333; line-height: 150%; font-family: arial;">Grooming Tips:</span><br /> 
                                Tick picking novice? Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Sed at erat. Phasellus condimentum. Nullam sed magna. Donec quis tellus in neque congue porttitor. Proin sit amet ligula id leo porta rutrum. <br /> 
                                <br /> 
                                <span style="font-weight: bold; font-size: 15px; color: #333333; line-height: 150%; font-family: arial;">Waterhole Dangers</span><br /> 
                                Watery oasis, or crocodilian cesspool from hell? As the dry season approaches, lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Sed at erat. Phasellus condimentum. Nullam sed magna. Donec quis tellus in neque congue porttitor. Proin sit amet ligula id leo porta rutrum. </span></td>  
                                <td style="font-size: 12px; width: 400px; color: #000000; line-height: 150%; font-family: trebuchet ms; background-color: #ffffff;" valign="top">  
                                <p><span style="font-weight: bold; font-size: 20px; color: #cc6600; line-height: 110%; font-family: arial;">Why Are Tigers So Mean?</span><br /> 
                                <span style="font-weight: normal; font-size: 11px; color: #666666; font-style: italic; font-family: arial;">by Frederick Von Chimpenheimer</span><br /> 
                                Recent psychological studies and brain scans have shown that tigers have naturally violent tendencies toward chimpanzees. &quot;There&apos;s sort of a banana-envy thing going on, which makes the average tiger very self-conscious around chimpanzees&quot; says Dr. Chimpfried Brown. Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Sed at erat. Phasellus condimentum. Nullam sed magna. Donec quis tellus in neque congue porttitor. Proin sit amet ligula id leo porta rutrum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In suscipit, pede a rutrum malesuada, lacus massa euismod neque, a hendrerit justo ante at eros. <a href="#">Clickitus heritus.</a> </p> 
                                <p><span style="font-weight: bold; font-size: 20px; color: #cc6600; line-height: 110%; font-family: arial;">Plantains vs. Bananas</span><br /> 
                                <span style="font-weight: normal; font-size: 11px; color: #666666; font-style: italic; font-family: arial;">by Francine Chimperson</span><br /> 
                                Throwing a party? There&apos;s no better way to anger your dinner guests than by accidentally serving them plantains instead of bananas. Avoid the poo flinging with these handy guidelines. Plantains look like over ripe bananas, and must be cooked before eaten. Bananas are softer, and don&apos;t cook very well (they get mushy). In suscipit, pede a rutrum malesuada, lacus massa euismod neque <a href="#">Clickitus heritus.</a> </p> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="border-top: #ffffff 10px solid; background-color: #ffffcc;" valign="top" colspan="2"><span style="font-size: 10px; color: #996600; line-height: 100%; font-family: verdana;">*|LIST:DESCRIPTION|* <br /> 
                                <br /> 
                                <a href="*|UNSUB|*">Unsubscribe</a> *|EMAIL|* from this list.<br /> 
                                <br /> 
                                Our mailing address is:<br /> 
                                *|LIST:ADDRESS|*<br /> 
                                <br /> 
                                Our telephone:<br /> 
                                *|LIST:PHONE|*<br /> 
                                <br /> 
                                Copyright (C) 2007 *|LIST:COMPANY|* All rights reserved.<br /> 
                                <br /> 
                                <a href="*|FORWARD|*">Forward</a> this email to a friend </span></td>  
                            </tr> 
                        </tbody> 
                    </table> 
                    </td> 
                </tr> 
            </tbody> 
        </table> 
      
 
        </Content> 
         
         <ImageManager ViewPaths="~/img" UploadPaths="~/img" MaxUploadFileSize="1024000" /> 
        </telerik:RadEditor> 
         
        <asp:Button ID="btn_createNewsletter" runat="server" Text="Save"   
            onclick="btn_createNewsletter_Click" /> 
             
          
    </form> 
</body> 
</html> 
 


CS Page:
using System;  
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.Data.SqlClient;  
using System.Web.Configuration;  
using Telerik.Web.UI;  
using System.IO;  
 
public partial class _Default : System.Web.UI.Page   
{  
    string connectionString = WebConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString;  
    string url, path = "";  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        url = String.Format("~/PDF/{0}.pdf", Template_content.ExportSettings.FileName);  
        path = Server.MapPath(url);  
         
    }  
 
      
 
    protected void btn_createNewsletter_Click(object sender, EventArgs e)  
    {  
        string str = Template_content.Content;  
 
        str = str.Replace("'","''");  
          
        DateTime dt = new DateTime();  
        string InsertSQL = "Insert Into Newsletter(Template,CreatedDate,NewsLetterName) Values ('" + str + "',@CreatedDate,'Template8') ";  
        SqlConnection conn = new SqlConnection(connectionString);  
        SqlCommand cmd = new SqlCommand(InsertSQL, conn);  
        cmd.Parameters.AddWithValue("@CreatedDate", DateTime.Now.Date);  
        conn.Open();  
        try 
        {  
            cmd.ExecuteNonQuery();  
            conn.Close();  
            //Template_content.ExportSettings.FileName = "MyPDFChinmay";  
              
            Template_content.ExportToPdf();  
              
              
 
        }  
        catch(Exception err)  
        {  
            conn.Close();  
        }  
 
          
 
    }  
 
    protected void Template_content_ExportContent(object sender, Telerik.Web.UI.EditorExportingArgs e)  
    {  
        if (File.Exists(path))  
        {  
            File.Delete(path);  
        }  
 
        using (FileStream fs = File.Create(path))  
        {  
            Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);  
            fs.Write(info, 0, info.Length);  
        }  
 
        Response.Redirect("Newsletter.aspx");  
 
    }  
      
}  
 

Please provide the workaround that solves my problem.

Regards,
Vipin Ajmera.

Tervel
Telerik team
 answered on 06 Aug 2009
1 answer
95 views
Recently we've noticed that when a control is added to an Ajax panel weird things are sometimes happening to the layout of the page.  For example, if using the RadDatePicker control the calendar might appear beneath the date text box rather than directly to the right of it.  Buttons at the bottom of a form, instead of laying out from right to left, will appear stacked vertically.  What is the reason for this and how do I correct it?  I've played around with increasing the width of the RadAjaxLoadingPanel to allow sufficient space but it does not seem to solve the problem.

Thanks in advance.

Rich
Sebastian
Telerik team
 answered on 06 Aug 2009
4 answers
141 views
Hi, I would like to know if its possible to change the readonly property of a textbox in an input manager from clientside. The thing is depending of certain validation in my page, i have to set the state of the textbox to readonly. And i can't use server side to do this i need to change the value from client side. Is there a way to change that property???

Thx and have a nice day!!

Guillaume
asim
Top achievements
Rank 1
 answered on 06 Aug 2009
1 answer
253 views
I have a button inside a RadAjaxPanel, when the button is clicked. There is a server-side call. I want it to execute a Javascript function defined in the page by using RegisterStartupScript . However, it is not working. If I remove RadAjaxPanel or move the button beyond of the panel, it does work. The client code is just like following
 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="LoadingPanel1"> <div id="app_layer" runat="server">  <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> </div> </telerik:RadAjaxPanel> <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" />

Your help is appreciated.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Princy
Top achievements
Rank 2
 answered on 06 Aug 2009
1 answer
104 views
To create a Linkbutton column that supports filtering and sorting, I'm using the technique shown here:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/filtering-and-sorting-for-gridbuttoncolumn.aspx

Here's my existing markup:

                    <custom:GridButtonColumnWithFilteringSorting HeaderText="Company" UniqueName="Company" 
                        HeaderStyle-Width="150px" ItemStyle-Width="150px" SortExpression="Company" Reorderable="false" 
                        Resizable="false" DataTextField="Company" DataField="Company" CommandName="Edit" 
                        ButtonType="LinkButton">  
                        <HeaderStyle Width="150px"></HeaderStyle> 
                        <ItemStyle Width="150px"></ItemStyle> 
                    </custom:GridButtonColumnWithFilteringSorting> 
 
I  need to know how to substitute a space (&nbsp;) character when there's no data in a column. Otherwise, I'm getting cells with no lines.

How do I add a space character to a custom grid button column?

BTW, if there's a better technique than the GridButtonColumnWithFilteringSorting solution, I'd be glad to see it.

Thanks,

Ken
Yavor
Telerik team
 answered on 06 Aug 2009
3 answers
122 views
Despite the thread title, this is not meant to be a bash of Telerik. When it comes to AJAX, i believe their controls are second to none. However, there are a couple instances where I believe they can imporve. This all has to do with the use of their controls in medium trust environments. Now, I am not a network admin, nor do I know a great deal about webserver setup, so I am coming to this as a novice. However, I do know that the vast majority of third party hosts use medium trust in their environments, and it is even becoming more prevelant to use this in dedicated server systems. So I think it is a huge problem, and only getting bigger.

My understanding of the issue is that lmitations in MS AJAX itself (the framework upon which Rad Ajax is built) produce the problems. Ok, that is certainly credible. However, it is very dfficult to find info on this on the Terlik site. On the "changes and backward compatibility" section of the Ajax help files, there is a small section that deals with this titled "Full DNN support". If you don't use DNN, I don't know why this would ever catch your eye. Also, this is not just a DNN issue. It effects all sorts of functionality. Telerik has two recommended approaches to avoid these issues in medium trust environments. The first is to set the AjaxManager RestoreOriginalRenderDelegate property to False. The second is to inherit your page from RadAjaxPage instead of the ASP.NET Page class. I will have more comments on these solutions below....

I
n my case I was introduced to this problem when I was trying to dynamically load usercontrols (with Ajax) that had javascript on them. I, and I am sure lots of other people, have spent a great deal of time trying to figure out why this doesn't work, as was described in this forum thread:

http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajax-manager-does-not-load-js-files-in-dynamically-loaded-user-control.aspx

there is also a blog relating to this issue, though the blogger doesn't seem to be responsive to comments.

http://blogs.telerik.com/tervelpeykov/posts/08-10-20/AJAX_Using_AJAX_to_load_a_usercontrol_that_has_JavaScript_declared_in_it.aspx

Anyhow, I was once again reintroduced to the Ajax limitations when trying to implement Telerik's ToolTipified grid example. I thought I was doing everyhting they were, but I just couldn't get the example to work properly. As it turns out, setting the AjaxManager RestoreOriginalRenderDelegate property to false did not allow the example to work properly. I haven't tested it out, but I bet a great deal of telerik's examples having to do with ajax don't work properly when this ajaxmanager property is set. So, in my opinion, this is not a particularly good solution to working in medium trust environments, if much of the functionality is limited or lost. And, as for inheriting from RadAjaxPage, I have not seen if that works perfectly, but it simply isn't an option in the majority of project I work on, becasue most of the projects I develop inherit from some other custom base class (not Page).

So, I have one suggestion and two questions regarding all fo this..

Suggestion: Please document these issues better. I'm sure its not a great sales practice to admit your product has problems in a widespread environment, however, I think people will be much happier if they save themselves some time instead of spending countless hours debugging their code when the issue was so easy to diagnose. I know I would have. Every one of your Ajax-related examples should have a note that they may not function properly if the AjaxManager RestoreOriginalRenderDelegate property is set to false (as you require to work in medium trust environments).

Quesiton 1: As I stated before, I accept that this whole issue stems from limitations in the MS Ajax framework, and asside from the documentation of it, I don't have a beef with what Telerik has done regarding the controls. However, given the large-scale reach of these limitations and their effect on so many projects, is Telerik investigating implementing their own work-arounds? If you can get to a point where your own examples work in medium trust environments without doing something as drastic as inheriting from a Telerik base classs, I think that would be sufficient.

Question 2: Does Telerik have any knowledge of Microsoft working on improving these limitations?

Sebastian
Telerik team
 answered on 06 Aug 2009
2 answers
123 views
How can i databind an editable grid (RadGrid2) that is placed inside a formtemplate of another grid (RadGrid1)? And how can I render the RadGrid2 to open all the rows editable at the same time? Using OnNeedDataSource in RadGrid2 doesn't seem to work.
Roy Halvorsen
Top achievements
Rank 1
 answered on 06 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?