Image Manager Issue With Latest Build

7 posts, 0 answers
  1. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 03 May 2012 Link to this post

    Since updating to your guys latest dll's we appear to have a problem with the Image Manager within the RadEditor.

    The image manager has a created date field built into it and this now appears to fall over since the last updates.

    The following code is what is being implemented:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            _RadFileExplorer = CType(Me.FindRadControl(Me.Page), Telerik.Web.UI.RadFileExplorer)
            If Not _RadFileExplorer Is Nothing Then
                _RadFileExplorer.Configuration.ContentProviderTypeName = GetType(CustomColumnsContentProvider).AssemblyQualifiedName
                AddHandler _RadFileExplorer.ExplorerPopulated, AddressOf RadFileExplorer_ExplorerPopulated
            End If
     
            'Add the created date column
            AddGridColumn("Creation Date", "Created", True)
     
            Dim splitter As RadSplitter = _RadFileExplorer.FindControl("splitter")
     
        End Sub


    Private Sub AddGridColumn(ByVal name As String, ByVal uniqueName As String, ByVal 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


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


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

    On both the .remove and .add of the grid column we are getting object reference errors. Are you guys aware of any  issues or anything that may have changed surrounding this since the latest updates.

    Thanks.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 03 May 2012 Link to this post

    Hi Elliot,

    In RadControls for ASP.NET AJAX Q1 2012 we have introduced new explorer mode for RadFileExplorer, ThumbnailView, which has been set as default mode for RadEditor's dialogs. In this configuration RadFileExplorer is using RadListView to display the FileItems and the Grid property returns Nothing (Null).

    As I can see from the provided code snippet you have modified the dialog to display custom columns in the Grid component which is not supported by the ThumbnailView mode.

    To avoid this error you can either:
    • Set RadFileExplorer's ExplorerMode property to Default
    • Check if RadFileExplorer's Grid property does not return Nothing

    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 03 May 2012 Link to this post

    Hi Dobromir,

    Thaks for the update. I have set the fileexpoler ExplorerMode to be default. However the grid is still coming back empty and thus causing errors.

    I commented out the population of the custom code and the explorer opened successfully in its original (non thumbnail) view.

    Please let me know if I misunderstood something.

    Thanks.


  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 03 May 2012 Link to this post

    Hi Elliot,

    Please excuse me for the misleading information.

    In order to configure ImageManager dialog to display the images in a grid you need to set its ViewMode property to Grid, e.g.:
    <telerik:RadEditor ID="RadEditor1" runat="server" ExternalDialogsPath="~/EditorDialogs">
        <ImageManager ViewPaths="~/Images" ViewMode="Grid" />
    </telerik:RadEditor>


    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 04 May 2012 Link to this post

    Thanks for that. I have set the viewmode as per below but this doesn't seem to have made a difference. Grid still comes back empty.

    Anything else required?

    Thanks



    <telerik:radeditor  ID="Workarea" ContentFilters="RemoveScripts,EncodeScripts,FixEnclosingP,IECleanAnchors,IndentHTMLContent" ExternalDialogsPath="/EditorDialogs/" runat="server" Height="500" Width="100%" OnClientLoad="OnEditorLoad" OnClientCommandExecuting="OnClientCommandExecuting" OnClientPasteHtml="OnClientPasteHtml" skin="Outlook" style="margin-right:3px;"
                 
                DocumentManager-MaxUploadFileSize="5120000"
                ImageManager-MaxUploadFileSize="1024000"
                MediaManager-MaxUploadFileSize="5120000"
                FlashManager-MaxUploadFileSize="5120000"           
                DocumentManager-SearchPatterns="*.doc,*.txt,*.docx,*.xls,*.xlsx,*.pdf,*.zip"
                ImageManager-SearchPatterns="*.gif,*.png,*.jpg,*.jpe,*.jpeg,*.bmp"
                MediaManager-SearchPatterns="*.wma,*.wmv,*.avi,*.wav,*.mpeg,*.mpg,*.mpe,*.mp3,*.m3u,*.mid,*.midi,*.snd"           
                FlashManager-SearchPatterns="*.swf" StripFormattingOptions="MsWord,Span,ConvertWordLists">
                    <ImageManager ViewMode="Grid"></ImageManager>
                    <Content>
                    </Content>  
                </telerik:radeditor>
  6. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 08 May 2012 Link to this post

    Hi Elliot,

    After further investigation on this scenario it seems that the Grid component of RadFileExplorer is initially not visible during Page_Load method and that is why the experienced error occurs.

    I was able to workaround the issue by accessing the Grid through the RadFileExplorer's FileList, e.g.:
    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
     
     
        _RadFileExplorer.FileList.Grid.Columns.Add(gridTemplateColumn1)
    End Sub
     
     
    Private Sub RemoveGridColumn(uniqueName As String)
        If Not [Object].Equals(_RadFileExplorer.FileList.Grid.Columns.FindByUniqueNameSafe(uniqueName), Nothing) Then
            _RadFileExplorer.FileList.Grid.Columns.Remove(_RadFileExplorer.Grid.Columns.FindByUniqueNameSafe(uniqueName))
        End If
    End Sub


    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 09 May 2012 Link to this post

    Works perfectly. Thanks for all your help Dobromir
Back to Top