Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
136 views
Is it possible to obtain a standard look on the input control?

Mixing the control with e.g. standard dropdownlist looks somwhat odd - and forcing me to use the RadComboBox (even though it in my case isn't necessary)

(... and I guess vice-versa, is it possible to obtain standard look on the combobox?).
Konstantin Petkov
Telerik team
 answered on 17 Apr 2008
1 answer
191 views
I can't seem to find a property that will display the min, max and current value.  I feel I must have missed something!  Is there really no way to show these numberic values?

I'd picture the min on the left of the slider, the max on the right, and the current value probably above.

Thanks,
Sarah
Svetlina Anati
Telerik team
 answered on 17 Apr 2008
2 answers
131 views
Telerik,

What happened to RadRotator in the Q1 2008 release? I have been waiting for a bug fix for a known issue for RadRotator since november-07.

Regards,
Sjur
Paul
Telerik team
 answered on 17 Apr 2008
10 answers
209 views
Hello,

Is it possible to capture an Ajax callback from a rowclick, and then update a part of the web page completely outside of the Grid.  I have a Dundas chart in a panel, and I need to capture the value in the selected row and then rebind the dundas chart using Ajax.  I have tried using AjaxManager to get the RadGrid to update the ASP:PANEL the Dundas chart resides in, but the chart doesnt get redrawn - nor does a loading panel cover the dundas chart.

I know the event is being fired and captured as I have traced it.

Forgetting the Dundas piece...how would you update a control outside of the Grid without using the Literal control I have seen in the documentation?

Thanks
Sebastian
Telerik team
 answered on 17 Apr 2008
1 answer
180 views
Hi,

Can't find an example of Minimize Zones for ASP.NET AJAX.

Does this feature exist for ASP.NET AJAX?
If not, is there a workaround for people wanting to upgrade to ASP.NET AJAX?

Thanks,
Brad
Georgi Tunev
Telerik team
 answered on 17 Apr 2008
1 answer
130 views
Hi

I'm trying to install 2008 Q1 release, and when start the instalation it's have a setup failure. I am also trying to post you this message in a bug report and in a support ticket, and I can`t write the post. There is a javascript error.

I don't know what happen, but I can not be stopped this time.


Best regards.
Steve
Telerik team
 answered on 17 Apr 2008
1 answer
355 views
I tried to get this included as a standard feature of the editor, but with no luck:

http://www.telerik.com/community/forums/thread/b311D-htbgg.aspx

So, I spent a few hours heeding the advice of the Telerik guys and extended their File Browser so that my users can do bulk uploads of files in a zipped file format.

I have posted a small project in the Code Library that demonstrates this in action, here:

http://www.telerik.com/community/code-library/submission/b311D-bdcktd.aspx

And, despite the heckling I'm sure to get, I still work in VB so the code posted here is in VB.  Use www.codechanger.com to convert to C# if you need.

Some notes on my own logic used here.  Since the user is allowed to upload a zip file we no longer know for sure what is contained in that file - it could be any combination of any kinds of files and / or directories.  I decided that I liked the feature of the user being able to upload directories of files so the code allows for that.  Essentially, this is the pseudocode:

1) Is the uploaded file a zip file?  If yes, then goto step 2, otherwise, proceed as normal.
2) Don't save the zip file to disk, begin extraction in-memory
3) For each entry in the zip file, determine if it's a file or a directory
4) If it's a file, delete the file if it already exists.  If it's a directory, create the directory.
5) Check that the file is a non-zip file that complies with the file types specified in the search patterns.  If it is a valid file, save it to disk.
6) Check that all directories and sub-directories contain image files.  If the directory is empty, delete it.  This is because a directory in the zip file could have contained an invalid file - but the directory would have still be created.
7) Try to return the path of the last extracted file to the File Browser Dialog - this doesn't work if the File Browser needs to change a directory but it does work in all other cases.

For those who don't want to download the whole project from the code library and just want to copy/paste the needed code for their own project, here's how it's done.

Step 1: Download and add a reference to the SharpZipLib.dll for your website / project.

Step 2: Extend the built-in FileSystemContentProvider.  The only method that needs to be overridden is the StoreFile method, but you'll also need to create a New(...) method.  Add the following class to your App_Code folder.  Note: to make the code smaller, I've removed all comments but hopefully it makes sense:

Imports ICSharpCode.SharpZipLib.Zip  
Imports System.IO  
Imports Telerik.Web.UI  
Imports Telerik.Web.UI.Widgets  
 
Public Class UnzipFileSystemContentProvider  
  Inherits FileSystemContentProvider  
 
  Public Sub New(ByVal context As HttpContext, ByVal searchPatterns As String(), ByVal viewPaths As String(), ByVal uploadPaths As String(), ByVal deletePaths As String(), ByVal selectedUrl As String, ByVal selectedItemTag As String)  
    MyBase.New(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)  
    Me.ProcessPaths(MyBase.ViewPaths)  
    Me.ProcessPaths(MyBase.UploadPaths)  
    Me.ProcessPaths(MyBase.DeletePaths)  
    MyBase.SelectedUrl = FileBrowserContentProvider.RemoveProtocolNameAndServerName(Me.GetAbsolutePath(MyBase.SelectedUrl))  
  End Sub 
 
  Public Overrides Function StoreFile(ByVal file As UploadedFile, ByVal path As String, ByVal name As String, ByVal ParamArray arguments As String()) As String 
    Dim relFolder As String = path  
    Dim relFull = IO.Path.Combine(relFolder, name)  
    Dim mapFolder As String = MyBase.Context.Server.MapPath(relFolder)  
    Dim mapFull As String = MyBase.Context.Server.MapPath(relFull)  
    If file.GetExtension = ".zip" Then 
      Dim lastValidFile As String = "" 
      Using ZIS As New ZipInputStream(file.InputStream)  
        Dim ZE As ZipEntry = ZIS.GetNextEntry  
        While Not IsNothing(ZE)  
          Dim strDir As String = IO.Path.GetDirectoryName(ZE.Name)  
          Dim strFil As String = IO.Path.GetFileName(ZE.Name)  
          If strDir.Length > 0 Then 
            IO.Directory.CreateDirectory(mapFolder & strDir)  
          End If 
          If strFil <> String.Empty Then 
            If IsValidFileTypeAfterUnZip(ZE.Name) Then 
              DeleteFileIfAlreadyExists(mapFolder & ZE.Name)  
              lastValidFile = relFolder & ZE.Name  
              Using FS As FileStream = IO.File.Create(mapFolder & ZE.Name)  
                Dim i As Integer = 2048  
                Dim b As Byte() = New Byte(2048) {}  
                While True 
                  i = ZIS.Read(b, 0, b.Length)  
                  If i > 0 Then 
                    FS.Write(b, 0, i)  
                  Else 
                    Exit While 
                  End If 
                End While 
              End Using  
            End If 
          End If 
          ZE = ZIS.GetNextEntry  
        End While 
      End Using  
      DeleteEmptyDirectoriesAfterZip(mapFolder)  
      Return lastValidFile  
    Else 
      DeleteFileIfAlreadyExists(mapFull)  
      file.SaveAs(mapFull)  
      Return relFull  
    End If 
  End Function 
 
  Private Sub DeleteFileIfAlreadyExists(ByVal mapFull As String)  
    If IO.File.Exists(mapFull) Then 
      IO.File.Delete(mapFull)  
    End If 
  End Sub 
 
  Private Sub DeleteEmptyDirectoriesAfterZip(ByVal mapFolder As String)  
    For Each Dir As String In IO.Directory.GetDirectories(mapFolder)  
      DeleteEmptyDirectoriesAfterZip(Dir)  
      If IO.Directory.GetFiles(Dir).Count = 0 And IO.Directory.GetDirectories(Dir).Count = 0 Then 
        IO.Directory.Delete(Dir)  
      End If 
    Next 
  End Sub 
 
  Private Function IsValidFileTypeAfterUnZip(ByVal fileName As String) As Boolean 
    Dim strExt As String = Right(fileName, fileName.Length - fileName.LastIndexOf(".")).ToLower  
    If strExt = ".zip" Then 
      Return False 
    Else 
      For Each s As String In MyBase.SearchPatterns  
        s = Right(s, s.Length - s.LastIndexOf(".")).ToLower  
        If s = strExt Then Return True 
      Next 
    End If 
    Return False 
  End Function 
 
End Class 
 

Step 3: Add the "*.zip" extension to the SearchPatterns of the Image/Document/Media/Etc Manager; which unfortunately also means you need to manually re-input all of the default file extensions.  This is what it looks like for the ImageManager (Note: I haven't brought back all of the default extensions):

<telerik:RadEditor runat="server" ID="RadEditor1" Skin="Default">  
  <ImageManager DeletePaths="~/Images/" SearchPatterns="*.gif,*.jpg,*.jpeg,*.jpe,*.tiff,*.tif,*.bmp,*.png,*.zip" UploadPaths="~/Images/" ViewPaths="~/Images/" /> 
</telerik:RadEditor>      
 

Step 4: Set the ContentProviderTypeName for the Image/Document/Media/Etc Manager that you want to enable zip files for:

RadEditor1.ImageManager.ContentProviderTypeName = GetType(UnzipFileSystemContentProvider).AssemblyQualifiedName  
 

Step 5: Make sure you add all the other necessary stuff required by the Editor in Q1 2008 and going forward, such as the HttpHandlers in the Web.config and the RadSpell dictionary in the App_Data folder.

Rumen
Telerik team
 answered on 17 Apr 2008
2 answers
107 views
When upgrading the 'classic' controls, I just installed 'em, removed the old references in my project and added them back pointing at the new version of the controls.

I've just done my first upgrade of AJAX controls (2007.3 to 2008.1) and did the same thing I'd do with the 'classic' controls. Whilst the project compiled OK when I tried to run it the system complained. Basically it was looking for the old version of the controls. I had a look in the web.config file and the <httphandlers> element included this ...
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2007.3.1425.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/> 
I changed the line to read the correct version number and everything was OK.

The question is, is having to make this change manually normal, or is there something else I should have done to ensure that the project was correctly updated?

--
Stuart

Dan
Top achievements
Rank 1
 answered on 17 Apr 2008
9 answers
261 views
This seems like a bug...

Assume that there is a valid toolsfile that does not have any modules in it.

1) Just using the toolsfile - the modules area does not appear
2) Just adding tools dynamically - modules area appears
3) Just adding tools dynamically and using RadEditor1.Modules.Clear - modules area appears
4) Using the tools file, clearing the tools and then re-adding them dynamically - the modules area does not apear.

I'll use #4 as a temporary hack but I do believe this is a bug.

I discovered this because I want my editor to add a tool dynamically in some cases, but not all cases.  For some unknown reason, sometimes when I went to add that last tool on an editor that was using a toolsfile, the added tool was the only one being displayed.  To add to the confusion - it was not always doing that although I think it may have to do with the editor being inside a FormView vs. being directly on the page.

In any case, that problem made me go to the entirely dynamic tools model (which I like better) but the modules area was showing up.
Rumen
Telerik team
 answered on 17 Apr 2008
1 answer
85 views
Hi

Im testing out the version 2007.3.1314.20 of the editor.

Initially it its hidden on the page due to its parent Panel being set to visible=false and it all sits inside an update panel.

i.e
  • UpdatePanel (UpdateMode="Conditional")
    • Panel (visible="false")
      • RadEditor
When i set the Panel to visible the editor shows but the styles dont come through so its just a bunch of bullets and anchor placeholders for your sprites rather than tools.

I have seen in the forums a similar problem to this back in previous releases of RadEditor but cant find anything about this issue when using the Prometheus release.

Thanks,

Rich

Tervel
Telerik team
 answered on 17 Apr 2008
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?