Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
120 views
In my website project I have a top-level file called "Common.cs" that is shared by all the forms in the project.  It contains common code that needs to access the Website UI.  I'd like to dynamically create a dialog box that will allow the user to enter additional comments in the event of an error.

I've written some code that is not crashing but yet no RadWindow is appearing.  Here's the crux of what I have so far:

    public static void ShowErrorDialog(string msg, Constants.ErrorCode category, string location, Control parent)<br>    {<br>      RadWindow rw = new RadWindow();<br>      rw.ID = "rwErrorHandling";<br>      rw.VisibleOnPageLoad = true;<br>      rw.CssClass = "errorDialog2";<br>      rw.Behaviors = WindowBehaviors.Move;<br>      rw.EnableShadow = true;<br>      rw.VisibleStatusbar = false;<br>      rw.VisibleTitlebar = true;<br>      rw.Visible = true;<br>      //rw.AutoSize = true;<br>      rw.Width = 300;<br>      rw.Height = 200;<br>      rw.Modal = true;<br>      <br>      // Much more code here to create the contents of the dialog box<br>      <br>      parent.Page.Controls[0].FindControl("form1").Controls.Add(rw);<br>    }

And here's a sample call to the method:

  Website.Common.ShowErrorDialog("Test message", Constants.ErrorCode.UnexpectedRecordCount, "buttonTest", Page);

Hoping someone can tell me why the RadWindow is not appearing,

Robert

P.S. In case it helps, here's displayed info from jQuery when I'm stepping through client-side code:

? $('div[id$=_rwNewMuckpile]')[0].id
"ctl00_ContentPlaceHolder1_Mucking_rwNewMuckpile"
    endsWith: function String$endsWith(suffix) {
    /// <summary locid="M:J#String.endsWith" />
    /// <param name="suffix" type="String"></param>
    /// <returns type="Boolean"></returns>
    var e = Function._validateParams(arguments, [
        {name: "suffix"
    startsWith: function String$startsWith(prefix) {
    /// <summary locid="M:J#String.startsWith" />
    /// <param name="prefix" type="String"></param>
    /// <returns type="Boolean"></returns>
    var e = Function._validateParams(arguments, [
        {name: "pre
    trim: function String$trim() {
    /// <summary locid="M:J#String.trim" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/^\s+|\s+$/g, '');
}
    trimEnd: function String$trimEnd() {
    /// <summary locid="M:J#String.trimEnd" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/\s+$/, '');
}
    trimStart: function String$trimStart() {
    /// <summary locid="M:J#String.trimStart" />
    /// <returns type="String"></returns>
    if (arguments.length !== 0) throw Error.parameterCount();
    return this.replace(/^\s+/, '');

So something "appears" to be there but if I make this call: $find($('div[id$=_rwNewMuckpile]')[0].id)
then I get 'null'.  :-(
Marin Bratanov
Telerik team
 answered on 31 Jan 2012
5 answers
599 views
Hi,

I tried this in the DetailTableDataBind event handler

GridBoundColumn b = new GridBoundColumn();
e.DetailTableView.Columns.Add(b);
b.HeaderText = "test";

the column is successfully added, but as soon as a postback occurs, the new column disappears. But adding a column the exact same way to the MasterTableView works as intended.

I am having the same issue as an unanswered question in the second half of this thread (by Bruno):
http://www.telerik.com/community/forums/aspnet-ajax/grid/dynamically-add-columns-to-existing-radgrid.aspx

Thanks,
Donald
Tsvetina
Telerik team
 answered on 31 Jan 2012
0 answers
115 views
I have defined a RadUpload control:

    <telerik:RadUpload MaxFileSize="512000" OverwriteExistingFiles="true" ControlObjectsVisibility="None"
          runat
="server" ID="RadUpload1" OnValidatingFile="uploadMedia_ValidatingFile"
          OnClientFileSelected
="uploadMedia_FileSelected" Width="500px" />
But this is rendered as:

<span class="ruFileWrap ruStyled" style="width: 80px;" jQuery171041561896132524767="11">
   
<input class="ruFileInput" id="ctl00_MainContent_Edit1_RadUpload1file0" submitName="ctl00_MainContent_Edit1_RadUpload1file0" type="file" size="23" unselectable="on" _events="[object Object]"/>
   
<label style="display: none;" for="ctl00_MainContent_Edit1_RadUpload1file0">
   
<input class="ruFakeInput" id="ctl00_MainContent_Edit1_RadUpload1TextBox0" type="text" size="22"/>
   
<label style="display: none;" for="ctl00_MainContent_Edit1_RadUpload1TextBox0">
   
<input class="ruButton ruBrowse" type="button" value="Select"/>

You may notice the style="width: 80px;" property. That's the bit that's causing problems, it's 'cutting off' the right half of the control. I've traced the style using IE's developer tool but all it's telling me is that it's 'Inline.' Where is this styling defined? Is it possible to override the 80px?

Thanks a lot.

EDIT: Please note that this happens regardless of whether I'm setting the EnableFileInputSkinning and InputSize properties, these where just set in attempt to solve the problem, and it didn't work.

EDIT: Please remove this thread, reposted in the right place: http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/problem-with-inline-styling.aspx 
Julien Pierre
Top achievements
Rank 1
 asked on 31 Jan 2012
1 answer
107 views
Hi,
We are trying to host ASP.NET website on GODADDY.COM
Some telerik control we used to make it look better but control fail to render as it render when run through VISUAL STUDIO.
Attached images will explain scenario...

Is there any tutorial which explain how to deploy Telerik Web Site?? 
Kate
Telerik team
 answered on 31 Jan 2012
4 answers
290 views
Is there any built-in method to convert a RadTreeNode object to a RadTreeNodeData object or vice versa in a RadTreeView?
Joel Kraft
Top achievements
Rank 2
 answered on 31 Jan 2012
13 answers
444 views
Multiple selection works by using ctrl key, but we have to click 20-30 times if we have to select many items. If the nodes are sorted, is there a way to select them shift style, so that all leaf nodes are selected between 2 clicks.
Bozhidar
Telerik team
 answered on 31 Jan 2012
3 answers
190 views
I have a treeview with a number of nodes that contain various editing controls that are generated from templates.  The problem is that the checkboxes are being treated like radio buttons as it will only allow one at a time to be checked.  When I check one, it appears the tree automatically unchecks any others in the entire tree, firing the checkchanged handler for each in its template.

This only seems to be exhibited when a checkbox is clicked, I can generate the tree with multiple check boxes checked, but as soon as you check one I see this behavior.

All the checkboxes have unique ID's.

When I place several checkboxes on the same page with their own checkchanged handlers, but outside of the tree, they do not demonstrate this behavior amongst themselves.  Although even checking one of these, the ones in the tree do.

I added some code to the checkchanged handlers in the templates and checked the __EVENTTARGET param and kicked it out of any that didn't match the ID of the sender.  This kept the underlying data correct, but when the page regenerates all the other checkboxes are still unchecked.  This would seem to imply that the tree is somehow forcing this on the controls when they're rendered.

If not I don't know where else this would be coming from.  Any insight is appreciated though.
Bozhidar
Telerik team
 answered on 31 Jan 2012
1 answer
112 views
Hi,

I need to get the currently selected tag.
So, i am using  editor.getSelectedElement();

in my editor has code in html like
<subelement id="717" type="complementary"><tag type="open" text="complementary" elem-tag="subelement">|</tag><p><tag type="open" text="p" elem-tag="p">|</tag>
       
 
      An increasing amount of information on complementary and alternative medicine is becoming available. The scope of the BNF is restricted to the discussion of conventional medicines but reference is made to complementary treatments if they affect conventional therapy (e.g. interactions with St John's wort—see Appendix 1). Further information on herbal medicines is available at
            
the design mode content looks like below.
complementary-and-alternative-medicine|
p| An increasing amount of information on complementary and alternative medicine is becoming available. The scope of the BNF is restricted to the discussion of conventional medicines but reference is made to complementary treatments if they affect conventional therapy (e.g. interactions with St John's wort—see Appendix 1). Further information on herbal medicines is available at XRef : http://www.mhra.gov.uk| www.mhra.gov.uk |Xref : http://www.mhra.gov.uk . |p
|complementary-and-alternative-medicine


when the user right cliks with in any of this tag, i need to get the selected tag in editor.

so, iam using  editor.getSelectedElement();

the tag format assigned in editor like'
<tag1><tag2><p>text</p></tag2><tag1>

tag1 is click, the getselectedelemat return the <p> tag always.

because the <p> is the editable tag, which contain the text.

but the user selected the not editable tag, that is the root tag of <p> tag.

How to get the exact tag that is selected in editor.

Thanks,
Uma
Rumen
Telerik team
 answered on 31 Jan 2012
2 answers
108 views
Hi,

i am getting the following error when RadToolTipManager loads a usercontrol (problem is with ie9 9.0.4)

RadToolTipManager response error:

Exception=Sys.WebForms.PageREquestManagerServerErrorExecution; An Unknown error occurred while processing the request on the server. the status code returned from the server was: 500

it is working fine with ie9 (9.0.2)

can please any one help me to resolve this issue.

Thank you in advance

Jai

Jay
Top achievements
Rank 1
 answered on 31 Jan 2012
2 answers
344 views
After implementing the RadCompression model on a previously working ashx page I was using for secure file downloads, itstopped working in Firefox, Chrome, & Safari, but continued to work in IE (tested v9).  I found 2 possible places for the error, but due to time constraints had to stop and simply remove the RadCompression module.

1.    On my development box, Win 7, IIS 7, flushing the data (context.Response.Flush()) between the header and the content caused the browsers listed above to report an invalid compression.

2. On my production server, Windows Server 2003, IIS 6, the browsers just sit there and spin, as if they are waiting for more content.  I think this is due to my manually adding a "Content-Length" based on the size of the uncompressed content.  Is there a sample showing the correct parameters to set when using RadCompression in this scenario?  My page, based on parameters, may return any of the following, and so I am also setting the content type and content-disposition headers manually:

    a.    HTML (text/html)
    b.    Text (text/plain)
    c.    Zip (application/zip)
    d.    Excel (application/vnd.ms-excel)
    e.    Excel 2007 (application/vns.openxmlformats-officedocument.spreadsheetml.sheet)
    f.    Jpg (image/jpeg)

These files are dynamically generated, so I would also like to specify "no-cache" in the sample as well.

The following is my working (without RadCompression) sample. (Again, it works in IE, but not others.)

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
 
        '''The following 2 lines do not seem to make a difference, but were added when trying to test
        context.Response.Clear
        context.Response.BufferOutput = True
 
        'Get the filename
        Dim fileName As String = context.Request.QueryString("i")
         
        'Get the file type
        Dim fileType As String = context.Request.QueryString("t")
         
        'Get the project name
        Dim projectName As String = Managers.SessionManager.ProjectName(context.Session)
         
        'Get the userId
        Dim userId As Integer = Managers.SessionManager.UserId(context.Session)
         
        'Make sure the project and user name are valid
        If IsProjectAndUserValid(projectName, userId) = True Then
         
            Dim securePath As String = Utilities.IO.GetSecureDirectory(Managers.ConfigManager.SecureOutput, projectName, userId)
         
            'Create the full physical path to the file       
            Dim fullPath As String = IO.Path.Combine(securePath, fileName)
         
            'See if the file exist
            If IO.File.Exists(fullPath) Then
                'Open a fileinfo object for the file
                Dim currentFileInfo As New IO.FileInfo(fullPath)
                 
                Select Case fileType.ToLower
                    Case "zip"
                        context.Response.AddHeader("Content-Disposition", "attachment;filename=MyZip.zip")
                        context.Response.ContentType = "application/zip"
                    Case "export"
                        'Get the fileextension
                        Dim fileExtension As String = IO.Path.GetExtension(fullPath)
                        If fileExtension = ".html" OrElse fileExtension = ".htm" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.htm")
                            context.Response.ContentType = "text/html"
                        ElseIf fileExtension = ".txt" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.txt")
                            context.Response.ContentType = "text/plain"
                        ElseIf fileExtension = ".xls" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xls")
                            context.Response.ContentType = "application/vnd.ms-excel"
                        ElseIf fileExtension = ".xlsx" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xlsx")
                            context.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                        End If
                    Case "print"
                        context.Response.ContentType = "text/html"
                    Case "image"
                        context.Response.AddHeader("Content-Disposition", "inline;filename=Print.jpg")
                        context.Response.ContentType = "image/jpeg"
                End Select
                 
                '''The following line has had inconsistant results in some browsers
                'context.Response.CacheControl = "no-cache"
                '''Is the following line is another (unconfirmed) problem for RadCompression?
                context.Response.AddHeader("Content-Length", currentFileInfo.Length.ToString)
                context.Response.StatusCode = 200
                ''''The following line breaks RadCompression in IIS7
                'context.Flush()
                context.Response.WriteFile(fullPath)
                context.Response.Flush()
                context.Response.End()
            Else
                context.Response.StatusCode = 200
                context.Response.Write("No data located for this request.")
                context.Response.End()
            End If
             
        End If     
         
    End Sub

Chuck
Top achievements
Rank 1
 answered on 31 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?