Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
245 views
Hello Friends


 I used functionality of export to excel in my radgrid.

Right now it is display in header center, i want to display it in header right allignment.

How i will do?

Please help me.

Thanks & Reagards
Jigensh Patel

Daniel
Telerik team
 answered on 17 Feb 2010
1 answer
118 views
Hello Friends

I used searching functionality in my page.

Page contain 1 textbox , 1 button and grid.

I will follow the below step.

(1) Add text in textbox than click on search.Records are display.
(2) Than i click on sorting for grid column than record are sorted and display, as that time i want to need to remove text from the textbox.

So i will remove text of textbox on sorting.

Thanks & Regards
Jignesh Patel

Dimo
Telerik team
 answered on 17 Feb 2010
2 answers
117 views
Hi,

Is there a way by which we can display a truncated value in a GridBoundColumn of Type DateTime. The value pulled from the database is "12/10/2010 03:10:07". This is is to be shown to the user as "12/10/2010" . 

Thanks
Phani Musale
Top achievements
Rank 1
 answered on 17 Feb 2010
2 answers
87 views
hi guys
i cave master and detail table
when i expand DetailTable and wanna chand paging DetailTable collapsed!
what is problem?

tnx
Farshad heidary
Top achievements
Rank 1
 answered on 17 Feb 2010
2 answers
196 views
Hello,

I have a RadGrid that is using a User Control as the method of editing items in my grid. My question is, how can I get the height of the user control using Javascript?

I need the height so that I can set the ScrollArea property in java script.

Thanks,
Dave
Dimo
Telerik team
 answered on 17 Feb 2010
5 answers
184 views
Hi,

I am using MOSSRadEditor in my sharepoint environment. In that environment I am also using my custom asp.net user control in which I am using the asp.net RadEditor.
Right now MOSSRadEditor's ImageManager is poinitng to an image library of sharepoint. I wanted to use the same Image Manager on asp.net Radeditor. I was able to use the same Tools file for both editors but things which are related to MOSS are not populating on asp.net RadEditor.
Or if anyone can guide me for using the MOSSRadEdiotor in cutom usercontrol then that can also help.

Any help is highly appreciated.
Stanimir
Telerik team
 answered on 17 Feb 2010
1 answer
95 views
Hi:

We have a RadWindow in our application that does some very sophisticated logic in the code behind. Generally we need to use the RadWindow to obtain certain preliminary information before we can invoke this logic.

But now we've come up with a situation where we want to invoke the logic directly without actually showing the RadWindow. The logic will ultimately open yet another window (to display a Word document) and, in this situation, the 'Word Document' window is the only window that we want to see.

Is there a way to do this using the code in the Radwindow code-behind?

Thanks for your suggestions.  
Svetlina Anati
Telerik team
 answered on 17 Feb 2010
10 answers
344 views
Ok everyone, I am sort of at your mercy here... I have spent several hours debugging trying to figure out why the manager aren't working and it seems to all point to that the new dialogs are expecting return strings in different formats.  Here is the background on the application environment.

The admin application that contains the editor is in a different directory / application than the public website where the content is rendered. The images and flash folders are sub folders of the public site and there is a third securedocuments folder that sits outside of the publicwwwroot.  These files are streamed using a httphandler.

Directory Structure:
    - Drive:\SolutionFolder
                                        -\adminwwwroot
                                        -\publicwwwroot
                                        -\publicwwwroot\Images
                                        -\publicwwwroot\Flash
                                        -\publicwwwroot\Documents

                                                                -\publicwwwroot
                                        -\securedocuments

URL Structure:
    - http://www.publicdomain.com/
                                                    /Images
                                                    /Flash
                                                    /Documents
                                                    /SecureDocuments.ashx?path=file.ext
    - http://adminsubdomain.publicdomain.com/
                                                                         /RadEditor.aspx?updatepage=1

I have worked with the code and got the files to list and new directories to create and delete.  But upload / rename files are still not working... I haven't tried saving an image using the image editor yet.

I will provide you the customcontentprovider code and the filesystem code that supplies the directory and url structure as seen above.  Here are my exact issues and what solutions I would like to see:
    1.) Rename File - Call Stack Shows RenameFile function being called in the RadFileExplorer class in the Telerik.web.ui.dll
             What changed? Why? Fixes?
    2.) Upload File - This is the highest priority for me to get fixed.  The StoreFile function doesn't even fire anymore.  I can't get the break point to work anymore after the upgrade.....

With all of the bugs in this new RadFileExplorer I would prefer to use the old managers if possible... Not sure how to do that... any help would be appreciated.  Thanks in advance!

New FileHandler Code (Partially Working):
Public Class ContentEditorProvider 
            Inherits FileBrowserContentProvider 
            Private _LoadDirectory As String 
            Private _ImgDirectory As String 
            Private _DocumentsDirectory As String 
            Private _SecureDocumentsDirectory As String 
            Private _FullPermissions As PathPermissions = PathPermissions.Read Or PathPermissions.Delete Or PathPermissions.Upload 
            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 StringByVal selectedItemTag As String
                MyBase.New(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag) 
            End Sub 
            Public Overloads Overrides ReadOnly Property CanCreateDirectory() As Boolean 
                Get 
                    Return True 
                End Get 
            End Property 
            Public Overrides Function CreateDirectory(ByVal path As StringByVal name As StringAs String 
                Dim RealPath As String = IO.FileSystem.ResolveDirectory(path) 
                Directory.CreateDirectory(RealPath & "\" & name) 
                Return path & name 
            End Function 
            Public Overrides Function DeleteDirectory(ByVal path As StringAs String 
                DeleteDirectory = IO.FileSystem.ResolveDirectory(path) 
                If Directory.Exists(DeleteDirectory) Then Directory.Delete(DeleteDirectory, True
                DeleteDirectory = String.Empty 
                Return DeleteDirectory 
            End Function 
            Public Overrides Function DeleteFile(ByVal path As StringAs String 
                DeleteFile = IO.FileSystem.ResolveDirectory(path) 
                If File.Exists(DeleteFile) Then File.Delete(DeleteFile) 
                DeleteFile = String.Empty 
                Return DeleteFile 
            End Function 
            Public Overrides Function GetFile(ByVal url As StringAs System.IO.Stream 
                Dim RealPath As String = IO.FileSystem.ResolveURL(url) 
                If System.IO.File.Exists(RealPath) = True Then 
                    Dim File As Byte() = System.IO.File.ReadAllBytes(RealPath) 
                    GetFile = New MemoryStream(File) 
                Else 
                    GetFile = Nothing 
                End If 
                Return GetFile 
            End Function 
            Private Function GetName(ByVal path As StringAs String 
                GetName = IIf(path = NothingString.Empty, path.Substring(path.LastIndexOf("\"c) + 1)) 
                Return GetName 
            End Function 
            Public Overrides Function GetFileName(ByVal url As StringAs String 
                GetFileName = IIf(url = NothingString.Empty, url.Substring(url.LastIndexOf("/"c) + 1)) 
                Return GetFileName 
            End Function 
            Public Overrides Function GetPath(ByVal url As StringAs String 
                GetPath = IO.FileSystem.ResolveURL(url) 
                Return GetPath 
            End Function 
            Public Function LoadFiles(ByVal Dir As System.IO.DirectoryInfo) As FileItem() 
                Dim xFiles As New List(Of FileItem) 
                For Each Fil As FileInfo In Dir.GetFiles() 
                    Dim RealPath As String = Fil.FullName 
                    Dim VirtualPath As String = IO.FileSystem.TranslateDirectory(RealPath) 
                    Dim VirtualURL As String = IO.FileSystem.TranslateURL(RealPath) 
                    xFiles.Add(New FileItem(Fil.Name, Fil.Extension, Fil.Length, VirtualPath, VirtualURL, VirtualPath, _FullPermissions)) 
                Next 
                Return xFiles.ToArray 
            End Function 
            Public Function LoadDirectories(ByVal Dir As System.IO.DirectoryInfo) As DirectoryItem() 
                Dim xDir As New List(Of DirectoryItem) 
                For Each SubDir As DirectoryInfo In Dir.GetDirectories() 
                    Dim RealPath As String = SubDir.FullName 
                    Dim VirtualPath As String = IO.FileSystem.TranslateDirectory(RealPath) 
                    xDir.Add(New DirectoryItem(SubDir.Name, VirtualPath, VirtualPath, VirtualPath, _FullPermissions, LoadFiles(SubDir), LoadDirectories(SubDir))) 
                Next 
                Return xDir.ToArray 
            End Function 
            Public Overrides Function ResolveDirectory(ByVal path As StringAs Telerik.Web.UI.Widgets.DirectoryItem 
                Dim RealPath As String = IO.FileSystem.ResolveDirectory(path) 
                Dim VirtualPath As String = IO.FileSystem.TranslateDirectory(RealPath) 
                Dim DirInfo As New DirectoryInfo(RealPath) 
                ResolveDirectory = New DirectoryItem(DirInfo.Name, VirtualPath, VirtualPath, IO.FileSystem.TranslateURL(VirtualPath), _FullPermissions, LoadFiles(DirInfo), LoadDirectories(DirInfo)) 
                Return ResolveDirectory 
            End Function 
            Public Overrides Function ResolveRootDirectoryAsList(ByVal path As StringAs Telerik.Web.UI.Widgets.DirectoryItem() 
                If path.StartsWith("/") = True Then path = IO.FileSystem.ResolveDirectory(path) 
                Dim RealPath As String = IO.FileSystem.ProcessDirectory(path) 
                Dim DirInfo As New DirectoryInfo(RealPath) 
                ResolveRootDirectoryAsList = LoadDirectories(DirInfo) 
                Return ResolveRootDirectoryAsList 
            End Function 
            Public Overrides Function ResolveRootDirectoryAsTree(ByVal path As StringAs Telerik.Web.UI.Widgets.DirectoryItem 
                If path.StartsWith("/") = True Then path = IO.FileSystem.ResolveDirectory(path) 
                Dim RealPath As String = IO.FileSystem.ProcessDirectory(path) 
                Dim VirtualPath As String = IO.FileSystem.TranslateDirectory(RealPath) 
                Dim DirInfo As New DirectoryInfo(RealPath) 
                'HttpContext.Current.Response.Write(path & " - " & RealPath & " - " & VirtualPath) 
                'HttpContext.Current.Response.End() 
                ResolveRootDirectoryAsTree = New DirectoryItem(DirInfo.Name, VirtualPath, VirtualPath, VirtualPath, _FullPermissions, LoadFiles(DirInfo), LoadDirectories(DirInfo)) 
                Return ResolveRootDirectoryAsTree 
            End Function 
            Public Overrides Function StoreBitmap(ByVal bitmap As System.Drawing.Bitmap, ByVal url As StringByVal format As System.Drawing.Imaging.ImageFormat) As String 
                Dim RealPath As String = IO.FileSystem.ResolveURL(url) 
                Dim newItemPath As String = IO.FileSystem.ResolveURL(url) 
                Dim name As String = GetName(newItemPath) 
                Dim _path As String = GetPath(newItemPath) 
                Dim tempFilePath As String = Path.GetTempFileName() 
                bitmap.Save(tempFilePath) 
                Dim content As Byte() 
                Using inputStream As FileStream = File.OpenRead(tempFilePath) 
                    Dim size As Long = inputStream.Length 
                    content = New Byte(size) {} 
                    inputStream.Read(content, 0, CType(size, Integer)) 
                End Using 
                If File.Exists(tempFilePath) Then 
                    File.Delete(tempFilePath) 
                End If 
                File.WriteAllBytes(RealPath, content) 
                Return url                 
            End Function 
            Public Overloads Overrides Function StoreFile(ByVal file As Telerik.Web.UI.UploadedFile, ByVal path As StringByVal name As StringByVal ParamArray arguments() As StringAs String 
                Dim FullName As String = IO.FileSystem.ResolveDirectory(path) & "\" & name 
                file.SaveAs(FullName) 
                Return path & name 
            End Function 
        End Class 

Original FileHandlerCode (Only the changed functions) (Works with Q3 2008)

Public Overrides Function CreateDirectory(ByVal path As StringByVal name As StringAs String 
                Dim RealPath As String = IO.FileSystem.ResolveDirectory(path) 
                Directory.CreateDirectory(RealPath & "\" & name) 
                Return path & "/" & name 
            End Function 
Public Overrides Function ResolveRootDirectoryAsList(ByVal path As StringAs Telerik.Web.UI.Widgets.DirectoryItem() 
                Dim RealPath As String = IO.FileSystem.ProcessDirectory(path) 
                Dim DirInfo As New DirectoryInfo(RealPath) 
                ResolveRootDirectoryAsList = LoadDirectories(DirInfo) 
                Return ResolveRootDirectoryAsList 
            End Function 
            Public Overrides Function ResolveRootDirectoryAsTree(ByVal path As StringAs Telerik.Web.UI.Widgets.DirectoryItem 
                Dim RealPath As String = IO.FileSystem.ProcessDirectory(path) 
                Dim VirtualPath As String = IO.FileSystem.TranslateDirectory(RealPath) 
                Dim DirInfo As New DirectoryInfo(RealPath) 
                'HttpContext.Current.Response.Write(path & " - " & RealPath & " - " & VirtualPath) 
                'HttpContext.Current.Response.End() 
                ResolveRootDirectoryAsTree = New DirectoryItem(DirInfo.Name, VirtualPath, VirtualPath, VirtualPath, _FullPermissions, LoadFiles(DirInfo), LoadDirectories(DirInfo)) 
                Return ResolveRootDirectoryAsTree 
            End Function 

Here is the IO.FileSystem Class

Public Class FileSystem 
        Public Shared siteDomain As String = Configuration.Environment.SiteDomain 
        Public Shared siteRoot As String = Configuration.Environment.SiteRoot 
        Public Shared siteSecureDocuments As String = Configuration.Environment.SiteSecureDocuments 
        Public Shared dirRoot As String = Configuration.FileSystem.RootDirectory 
        Public Shared rgxDirRoot As String = Replace(dirRoot, "\""\\"
        Public Shared dirDomain As String = Configuration.FileSystem.PublicSiteDirectory 
        Public Shared rgxDirDomain As String = Replace(dirDomain, "\""\\"
        Public Shared dirSecureDocuments As String = Configuration.FileSystem.SecureDocumentsDirectory 
        Public Shared rgxDirSecureDocuments As String = Replace(dirSecureDocuments, "\""\\"
        Public Shared vfsSecureDocuments As String = Replace(siteSecureDocuments, "\""/"
        Public Shared Function QueryDirectory(ByVal path As StringOptional ByVal search As String = "*.*"Optional ByVal options As SearchOption = SearchOption.TopDirectoryOnly) As ListItemCollection 
            QueryDirectory = New ListItemCollection 
            Dim xDir As New DirectoryInfo(path) 
            path = Replace(path, "\""\\"
            For Each xFile As FileInfo In xDir.GetFiles(search, options) 
                QueryDirectory.Add(New ListItem(Replace(Regex.Replace(xFile.FullName, path, "", RegexOptions.IgnoreCase), "\""/"))) 
            Next 
            Return QueryDirectory 
        End Function 
        Public Shared Function ProcessDirectory(ByVal path As StringAs String 
            ProcessDirectory = path 
            Dim _TokenPattern As String = "\[\[(?<ConfigVar>(.)*?)\]\]" 
            Dim _RM As Match = Regex.Match(path, _TokenPattern) 
            Dim HasMatch As Boolean = False 
            HasMatch = _RM.Success 
            While HasMatch = True 
                Dim _Token As String = _RM.Groups("ConfigVar").Value 
                'System.Web.HttpContext.Current.Response.Write(_Token & "<br />") 
                _Token = Configuration.AppSettings.GetSetting(_Token) 
 
                'System.Web.HttpContext.Current.Response.Write(_Token) 
                'System.Web.HttpContext.Current.Response.End() 
                ProcessDirectory = Replace(ProcessDirectory, _RM.Value, _Token) 
                _RM = _RM.NextMatch() 
                HasMatch = _RM.Success 
            End While 
            ProcessDirectory = Replace(ProcessDirectory, "/""\"
            Return ProcessDirectory 
        End Function 
        Public Shared Function ResolveDirectory(ByVal path As StringAs String 
            ResolveDirectory = path 
            If InStrRev(ResolveDirectory, ".") > InStrRev(ResolveDirectory, "/"Then 
                ResolveDirectory = Left(ResolveDirectory, InStrRev(ResolveDirectory, "/")) 
            End If 
            If ResolveDirectory.StartsWith(dirRoot) = False Then 
                If ResolveDirectory.StartsWith(vfsSecureDocuments) = True Then 
                    ResolveDirectory = Regex.Replace(ResolveDirectory, vfsSecureDocuments, dirRoot & dirSecureDocuments, RegexOptions.IgnoreCase) 
                    ResolveDirectory = Replace(ResolveDirectory, "/""\"
                Else 
                    ResolveDirectory = dirRoot & dirDomain & ResolveDirectory 
                    ResolveDirectory = Replace(ResolveDirectory, "/""\"
                End If 
            End If 
            Return ResolveDirectory 
        End Function 
        Public Shared Function ResolveURL(ByVal Url As StringAs String 
            If siteRoot.Length > 0 Then siteRoot = Left(siteRoot, siteRoot.Length - 1) 
            ResolveURL = Url 
            ResolveURL = Regex.Replace(ResolveURL, siteDomain & siteRoot, String.Empty, RegexOptions.IgnoreCase) 
            ResolveURL = ResolveDirectory(ResolveURL) 
            Return ResolveURL 
        End Function 
        Public Shared Function TranslateURL(ByVal path As StringAs String 
            Dim strSiteRoot As String = siteRoot 
            If strSiteRoot.Length > 0 Then siteRoot = Left(strSiteRoot, siteRoot.Length - 1) 
            path = Regex.Replace(path, rgxDirRoot, "", RegexOptions.IgnoreCase) 
            path = Regex.Replace(path, rgxDirSecureDocuments, siteDomain & siteSecureDocuments, RegexOptions.IgnoreCase) 
            path = Regex.Replace(path, rgxDirDomain, siteDomain & strSiteRoot, RegexOptions.IgnoreCase) 
            path = Replace(path, "\""/"
            TranslateURL = path 
            Return TranslateURL 
        End Function 
        Public Shared Function TranslateDirectory(ByVal path As StringAs String 
            path = Regex.Replace(path, rgxDirRoot, "", RegexOptions.IgnoreCase) 
            path = Regex.Replace(path, rgxDirDomain, "", RegexOptions.IgnoreCase) 
            path = Regex.Replace(path, rgxDirSecureDocuments, vfsSecureDocuments, RegexOptions.IgnoreCase) 
            path = Replace(path, "\""/"
            TranslateDirectory = path 
            Return TranslateDirectory 
        End Function 
    End Class 




Fiko
Telerik team
 answered on 17 Feb 2010
0 answers
52 views
Hi,
 How can I show the Inline Insert Form of scheduler when I drop an Item from DataGrid to Scheduler?
Prajeesh Prabhakar
Top achievements
Rank 1
 asked on 17 Feb 2010
1 answer
57 views
Hello!
I have a problem.
In form telerik:RadGrid. And popupmenu is not displayed in FireFox browser. But in Internet Explorer popup menu is displayed!!!
Please help me!
Dimo
Telerik team
 answered on 17 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?