Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
156 views
I added a date column to the file explorer and it was working.  I has recently stopped working and I cannot find any reason.  I am getting the following error 

Could not find a part of the path 'D:\www\FreeCE_Net\www\Files\Instructors\~\Files\Instructors\'.



The error is catching on Dim oldItem As DirectoryItem = MyBase.ResolveDirectory(path) in my Public OverLoads Overrides Function ResolveDirectoryPath.  

I have double checked the path it does exist.

.aspx code:

<script type="text/javascript">
        //<![CDATA[


    function OnClientFileOpen(oExplorer, args) {
        var item = args.get_item();
        var fileExtension = item.get_extension();




        if (1 == 1) {// Download the file 
            // File is a image document, do not open a new window


            args.set_cancel(true);


            // Tell browser to open file directly
            var requestImage = "Handler.ashx?path=" + item.get_url();
            document.location = requestImage;
        }
    }
        //]]>
    </script>


    <div style="float: left">
        <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" Width="734px" Height="400px"
             onclientfileopen="OnClientFileOpen" EnableOpenFile="true" OnExplorerPopulated="RadFileExplorer1_ExplorerPopulated">
            <Configuration ViewPaths="~/Files/Instructors/" DeletePaths="~/Files/Instructors/" SearchPatterns="~/Files/Instructors/"
                UploadPaths="~/Files/Instructors/" />
        </telerik:RadFileExplorer>
    </div>


aspx.vb code:


Imports System
Imports System.Collections
Imports System.Data
Imports System.Configuration
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Web
Imports System.Collections.Generic
Imports Telerik.Web.UI.Widgets
Imports Telerik.Web.UI






Partial Class Admin_InstructorFileManager2
    Inherits FreeCE.Web.UI.Page
    Protected Sub Page_Load(sender As Object, e As EventArgs)
        If Not IsPostBack Then
            'be sure to set content provider first before doing anything involving paths (e.g. set InitialPath)
            RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomColumnsContentProvider).AssemblyQualifiedName
            RadFileExplorer1.InitialPath = Page.ResolveUrl("~/Files/Instructors/")




        End If
        'AddDateAndOwnerColumns()
    End Sub




    Protected Sub RadFileExplorer1_Load(sender As Object, e As System.EventArgs) Handles RadFileExplorer1.Load
        RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomColumnsContentProvider).AssemblyQualifiedName
        RadFileExplorer1.InitialPath = Page.ResolveUrl("~/Files/Instructors/")
        Dim gridTemplateColumn1 As New GridTemplateColumn()
        gridTemplateColumn1.HeaderText = "Creation Date"
        gridTemplateColumn1.SortExpression = "Date"
        gridTemplateColumn1.UniqueName = "Date"
        gridTemplateColumn1.DataField = "Date"
        ' Add the first column
        RadFileExplorer1.Grid.Columns.Add(gridTemplateColumn1)
    End Sub


    Private Sub AddGridColumn(name As String, uniqueName As String, sortable As Boolean)
        'remove first if grid has a column with that name
        RemoveGridColumn(uniqueName)
        ' Add a new column with the specified name
        Dim gridTemplateColumn1 As New GridTemplateColumn()
        gridTemplateColumn1.HeaderText = name
        If sortable Then
            gridTemplateColumn1.SortExpression = uniqueName
        End If
        gridTemplateColumn1.UniqueName = uniqueName
        gridTemplateColumn1.DataField = uniqueName


        RadFileExplorer1.Grid.Columns.Add(gridTemplateColumn1)
    End Sub


    Private Sub RemoveGridColumn(uniqueName As String)
        If Not [Object].Equals(RadFileExplorer1.Grid.Columns.FindByUniqueNameSafe(uniqueName), Nothing) Then
            RadFileExplorer1.Grid.Columns.Remove(RadFileExplorer1.Grid.Columns.FindByUniqueNameSafe(uniqueName))
        End If
    End Sub


    Private Sub AddDateAndOwnerColumns()




        AddGridColumn("Creation Date", "Date", True)




    End Sub


    Protected Sub RadFileExplorer1_ExplorerPopulated(sender As Object, e As RadFileExplorerPopulatedEventArgs)
        'implement sorting for the custom Date column
        Dim sortingColumn As String = e.SortColumnName
        If sortingColumn = "Date" Then
            Dim dc As New DateComparer()
            e.List.Sort(dc)
            If e.SortDirection.IndexOf("DESC") <> -1 Then
                'reverse order
                e.List.Reverse()
            End If
        End If
    End Sub


    Public Class DateComparer
        Implements IComparer(Of FileBrowserItem)
        Function Compare(item1 As FileBrowserItem, item2 As FileBrowserItem) As Integer Implements IComparer(Of FileBrowserItem).Compare
            'treat folders separate from files
            Dim date1 As DateTime = DateTime.Parse(item1.Attributes("Date"))
            Dim date2 As DateTime = DateTime.Parse(item2.Attributes("Date"))
            If TypeOf item1 Is DirectoryItem Then
                If TypeOf item2 Is DirectoryItem Then
                    Return DateTime.Compare(date1, date2)
                Else
                    Return -1
                End If
            Else
                If TypeOf item2 Is DirectoryItem Then
                    Return 1
                Else
                    Return DateTime.Compare(date1, date2)
                End If
            End If
        End Function
    End Class


    Public Class CustomColumnsContentProvider
        Inherits FileSystemContentProvider
        Public Sub New(context As HttpContext, searchPatterns As String(), viewPaths As String(), uploadPaths As String(), deletePaths As String(), selectedUrl As String, _
            selectedItemTag As String)
            ' Declaring a constructor is required when creating a custom content provider class
            MyBase.New(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, _
                selectedItemTag)
        End Sub




        Public Overloads Overrides Function ResolveDirectory(path As String) As DirectoryItem
            ' Update all file items with the additional information (date, owner)
            Dim oldItem As DirectoryItem = MyBase.ResolveDirectory(path)


            For Each fileItem As FileItem In oldItem.Files
                ' Get the information from the physical file
                Dim fInfo As New FileInfo(Context.Server.MapPath(VirtualPathUtility.AppendTrailingSlash(oldItem.Path) + fileItem.Name))


                ' Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer
                ' If the name attribute matches the unique name of a grid column


                fileItem.Attributes.Add("Date", fInfo.CreationTime.ToString())


                ' Type targetType = typeof(System.Security.Principal.NTAccount);
                ' string value = fInfo.GetAccessControl().GetOwner(targetType).Value.Replace("\\", "\\\\");
                'Dim ownerName As String = "PharmCon"
                'fileItem.Attributes.Add("Owner", ownerName)
            Next


            Return oldItem
        End Function


        Public Overloads Overrides Function ResolveRootDirectoryAsTree(path As String) As DirectoryItem
            ' Update all directory items with the additional information (date, owner)
            Dim oldItem As DirectoryItem = MyBase.ResolveRootDirectoryAsTree(path)


            For Each dirItem As DirectoryItem In oldItem.Directories
                ' Get the information from the physical directory
                Dim dInfo As New DirectoryInfo(Context.Server.MapPath(VirtualPathUtility.AppendTrailingSlash(dirItem.Path)))


                ' Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer
                ' If the name attribute matches the unique name of a grid column


                dirItem.Attributes.Add("Date", dInfo.LastWriteTime.ToString())


                'Type targetType = typeof(System.Security.Principal.NTAccount);
                'string value = dInfo.GetAccessControl().GetOwner(targetType).Value.Replace("\\", "\\\\");
                'Dim ownerName As String = "PharmCon"
                ' dirItem.Attributes.Add("Owner", ownerName)
            Next
            Return oldItem
        End Function
    End Class




End Class




Jarrett
Top achievements
Rank 2
 answered on 13 Feb 2012
7 answers
381 views
Hello,

I have an ASP.NET Ajax Web Application in .NET 2.0. Every pages are wrapped inside an update panel. In one of the pages, I have a RadWindow. The page displayed in the RadWindow is wrapped inside an updatepanel. There are various ajax controls set in there (not rad but the regular ajax controls like TextBoxWaterMark, ModalPopup, Calendar, etc). They all work fine without any problem.

When I put this application in SharePoint, the ajax controls in the RadWindow do not work. RadWindow is popped up with all controls and stylesheet intact. The update panel works, everything is asynchronous. But ajax doesn't work. The calendar doesn't show up, text supposed to be textbox watermark thinks as if it is a regular typed in text, and modal popup doesn't show up.

Is this a bug or am I doing something wrong?
asilioni
Top achievements
Rank 1
 answered on 13 Feb 2012
1 answer
899 views
I am trying to load a simple RadWindow that will contain a google map.  The link is correct, but for some reason when I open it in a RadWindow I get a blank page.  Not a 404 or any other error, just blank.

<script type="text/javascript">
 
        function OpenMap(URL) {
            var wnd = window.radopen(URL, null);
            wnd.setSize(520, 520);
            wnd.center();
            return false;
        }
 
    </script>
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="True"
        KeepInScreenBounds="True" Skin="Windows7" EnableViewState="False"
        Behaviors="Close, Move">
    </telerik:RadWindowManager>

Then here is my link on the page:
<a href="#" onclick="return OpenDealerMap('http://maps.google.com/?q=1600%20Fedex%20Way%20%20Landover,%20Maryland%2020785&zoom=20&size=512x512&maptype=roadmap')">Map It</a>
Marin Bratanov
Telerik team
 answered on 13 Feb 2012
2 answers
88 views
Hi,


What have you changed recently in your themes? There seems to be some problems with the rendering of your controls under IE 9. Please check the image bellow. Even on your demos they don't appear correctly, but if needed I can provide sample projects. See this one for example - http://demos.telerik.com/aspnet-ajax/combobox/examples/default/defaultcs.aspx - compare IE9 and Chrome.

Please let me know how can I fix this. It seems to be working fine in Chrome though.


Kind Regards,

Ivan Zlatanov.
Ivan Zlatanov
Top achievements
Rank 1
 answered on 13 Feb 2012
2 answers
81 views
In my solution I have RadSplitter with two panes top / bottom. RadRibbonBar is placed inside top pane, content inside bottom.
How can I make RibbonBarMenu to appear above bottom pane (now it hides underneath bottom pane - see attached file)?

piotre6
Top achievements
Rank 1
 answered on 13 Feb 2012
4 answers
132 views
Hi all,

I have a RadWindow control that has its NavigateURL set to an aspx page in my application. The window is displayed as a result of the user selecting an item from the RadToolBar. I have the window loading correctly, but it seems like the first time the window loads, it uses some predefined dimensions and then snaps to the size of the content. This looks really ugly. If I close the window and open it again, it loads fine until the parent page is reloaded and then it starts all over again.

Is there any way to get the content to load before the window is shown so that it has time to figure out the required dimensions? I have tried calling the autoSize method from the ClientOnPageLoad, but that didn't work.

Any recommendations?

Thanks,
Jen
Marin Bratanov
Telerik team
 answered on 13 Feb 2012
2 answers
131 views
Hi guy's

I'm using Radeditor on a ASP.Net webpage using VB.NET
On the page I use an radeditor with enabled = false just to show HTML content and use some features of the editor.

The content below is sample content and when I try to export to PDF it gives me an error.
When I remove the image all works fine.

I used the sample database content provider and everything worked fine except the export to PDF with images having that database path still in the source string.

So I made my program that the images are stored in the db manually and just before loading the content I load the images from the db manually so that the images in the content can use local (virtual) references.

Does anybody see what's wrong with the image in my sample content and especially the image waterlelies.jpg ??

The error comes after i clicked "open" in the pdf dialog and it say's that de pdf cannot be opened because the filetype is not supported by acrobat reader. If I save the pdf it's size is 0kb ...

Where can I see more detaild error subscription?

Regards,

Rick Rehorst

Sample content:
h2 id="H1.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 1</span></h2><br/>Dit is een test voor klant 8<br />
<br />
Ik kan hier plaatjes invoegen<br />
<br />
<span style="font-family: ms sans serif;">Een ander lettertype selecteren<br />
</span><br />
en een opssomminkje maken<br />
<ul>
    <li>test</li>
    <li>test2</li>
    <li>test3</li>
    <li><fieldset style="width: 200px; height: 76px;"><legend>Title</legend>Content... </fieldset> </li>
</ul><h2 id="H1.1"><span style='color: #e36c09; font-size: 18px;'>1.1 Gegevens</span></h2><br/><img alt="" src="/RadControlsWebSite1/imgtemp/Waterlelies.jpg" />Empty <br />
<br /><h2 id="H1.2"><span style='color: #e36c09; font-size: 18px;'>1.2 Beschrijving</span></h2><br/>Empty <br />
<br /><h2 id="H2.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 2</span></h2><br/>Dit is hoofdstuk 2<br />
<br /><h2 id="H2.1"><span style='color: #e36c09; font-size: 18px;'>2.1 Gegevens</span></h2><br/>Empty <br />
<br /><h2 id="H3.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 3</span></h2><br/>Empty <br/><br/><h2 id="H4.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 4</span></h2><br/>Dit is Hoofdstuk 4<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
<p>Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
<br />
<br />
</p>
Rumen
Telerik team
 answered on 13 Feb 2012
3 answers
271 views

I have a repeater control in which I hava 2 labels and a radcombo box. I am able to populate the labels and the radcombobox.

The way it should work is I need to map a label text to the value in the radcombo box . The problem is even though the value in the combo is selected it keeps reseting to the first item in the drop down list.
Can someone help me to keep the selected value of the radcombo box selected.See attached jpg.

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <h2>Server Request Dynamic Reports Creation</h2>
<p>
      
    <telerik:RadScriptManager ID="rsmDynamicReports" Runat="server">
    </telerik:RadScriptManager>    </p>
  
       
      <telerik:RadAjaxPanel ID="RadDynamicRpt" runat="server" HorizontalAlign="NotSet"  >
         <table id="telerikTable"  >
            <tr valign = "top">
                <td  > <asp:Label ID="lblRptServer" runat="server" Text="Report Server :" Font-Size="Small"></asp:Label></td>
                            <td colspan= "2" > <asp:DropDownList ID="ddlDynamicRpt" runat="server" AutoPostBack="True" ForeColor="#3366FF" Font-Size="Small">
                                    <asp:ListItem Value="0">--Select One--</asp:ListItem> </asp:DropDownList></td>
         
            </tr
            <tr valign="top">
                <td colspan="3" ><asp:Label ID="lblReportName" runat="server" Text="Select Report :" Font-Size="Small"></asp:Label></td>
          
            </tr>
            <tr valign="top">
                <td  ></td>
                    <td  colspan="2"
            <div style="width: 396px">
                <asp:Panel ID="panel1" Width="400px" BorderStyle="Solid" BorderWidth ="1pt" ScrollBars="Vertical"    runat="server">         
                <asp:TreeView ID="tvCatalog" runat="server" AutoGenerateDataBindings="true" 
                        BorderStyle= "none" Height="100px" Font-Size="Small" >
             
                </asp:TreeView>      
            
                </asp:Panel>                     
            
        </div></td>
         
     </tr>
      <tr valign="top">
        <td  ><asp:Label ID="label1" runat="server" Text="Report Path :" Font-Size="Small"></asp:Label></td>
        <td colspan="2"><telerik:RadTextBox ID="RadPath" runat="server" Width=398px 
                ForeColor="#3366FF" BorderStyle="Solid" BorderWidth="1pt" Enabled="False" 
                Font-Size="Small"></telerik:RadTextBox></td>
          
     </tr>
     <tr valign="top">
     <td></td>
     <td colspan="2">
                 <table>
                  
            <asp:Repeater ID="rptFields" runat="server" >
                <HeaderTemplate>
                    <tr>
                        <td width="150px">
                            <asp:Label ID="lblReportParam" runat="server"  ForeColor="Blue" Text="Report Parameter" Font-Bold="true"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblServeRequest" runat="server" ForeColor="Blue"  Text="Server Request Field" Font-Bold="true"></asp:Label>
                        </td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:Label ID="lblReportParamField" runat="server" Text='<%# Bind("RptParam") %>'></asp:Label>
                        </td>
                        <td>
                              
                 <telerik:RadComboBox ID="rcbServerRequest" runat="server"  OnItemDataBound="rptFields_ItemDataBound" >
                   
                 </telerik:RadComboBox>
                   
  
                        </td>
                          
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            </table>
  
  
       
     </td>
     </tr
     <tr valign = "top">
                <td  > </td>
                            <td colspan= "2"
                                <asp:Button ID="btnrpt" runat="server" Text="Submit" /></td>
         
            </tr
     </table>
        </telerik:RadAjaxPanel>
  
</asp:Content>

 

Dimitar Terziev
Telerik team
 answered on 13 Feb 2012
2 answers
90 views
I would like to do a postback with onClientHiding.... It seems that onClientHiding does fire but the postback is not..

   function OnClientHiding(sender, args) {
        __doPostBack('<%=btnCloseMessage.ClientID %>', 'OnClick');
    }
 
<asp:UpdatePanel ID="Message" runat="server" ChildrenAsTriggers="True" UpdateMode="Conditional"
    Visible="True">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnCloseMessage" EventName="Click" />
    </Triggers>
    <ContentTemplate>
        <div style="visibility: hidden; height: 1px; width: 1px; overflow: hidden">
            <telerik:RadButton ID="btnCloseMessage" runat="server" OnClick="btnCloseMessage_Click" CausesValidation="False">
            </telerik:RadButton>
        </div>
        <telerik:RadNotification ID="RadNotification1" runat="server" Skin="Black" AutoCloseDelay="0"
            VisibleOnPageLoad="False" Width="300" Animation="Fade" EnableRoundedCorners="true"
            OnClientHiding="OnClientHiding" EnableShadow="true" Title="Breaking News" OffsetX="-20"
            OffsetY="-20">
            <ContentTemplate>
                <asp:Literal ID="litMessage" runat="server"></asp:Literal>
            </ContentTemplate>
        </telerik:RadNotification>
        <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
        </asp:Timer>
    </ContentTemplate>
</asp:UpdatePanel>
Svetlina Anati
Telerik team
 answered on 13 Feb 2012
3 answers
200 views
Hi,

I have a radupload control. When I deploy the site to the server the select button does not render and I only see a cropped text input. I can click on that and select a file but it's not intuitive for the user.

I've gone through the forum threads and tried several things but none of them seemed to work. I've also tried the suggestions under http://www.telerik.com/help/aspnet-ajax/upload-select-button-not-visible-in-ie.html.

It renders fine when I run it through my visual studio but the sleect is not visible when deployed on the server.

Please help.
Bozhidar
Telerik team
 answered on 13 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?