This is a migrated thread and some comments may be shown as answers.
Image Manager Issue With Latest Build
6 Answers 34 Views
This is a migrated thread and some comments may be shown as answers.
Jibber4568
Top achievements
Rank 1
Jibber4568 asked on 03 May 2012, 10:23 AM
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.

6 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 03 May 2012, 01:49 PM
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.
0
Jibber4568
Top achievements
Rank 1
answered on 03 May 2012, 02:30 PM
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.


0
Dobromir
Telerik team
answered on 03 May 2012, 03:04 PM
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.
0
Jibber4568
Top achievements
Rank 1
answered on 04 May 2012, 10:25 AM
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>
0
Dobromir
Telerik team
answered on 08 May 2012, 05:38 PM
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.
0
Jibber4568
Top achievements
Rank 1
answered on 09 May 2012, 09:33 AM
Works perfectly. Thanks for all your help Dobromir
Asked by
Jibber4568
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Jibber4568
Top achievements
Rank 1
Share this question
or