Grid-mode from DialogOpener

2 posts, 0 answers
  1. Tore Fremmersvik
    Tore Fremmersvik avatar
    1 posts
    Member since:
    Mar 2008

    Posted 07 Mar 2012 Link to this post

    Is there a way to set viewmode to grid when opening an ImageManager from a DialogOpener?

    We are using a custom provider for filehandling, so the thumbnail view is slowing down the filemanagers (db queries, getting files, resizing thumbs etc)

    <telerik:RadDialogOpener runat="server" id="DialogOpener1"></telerik:RadDialogOpener>
    <button onclick="$find('<%= DialogOpener1.ClientID %>').open('ImageManager', {CssClasses: []});SetCurrentUserControl('<%= DialogOpener1.ClientID %>');return false;">
       Find picture... 

    protected new void Page_Load(object sender, EventArgs e)
        FileManagerDialogParameters dialogParameters = new FileManagerDialogParameters();
        dialogParameters.ViewPaths = new[] { "root" };
        dialogParameters.UploadPaths = new[] { "root" };
        dialogParameters.DeletePaths = new[] { "root" };
        dialogParameters.MaxUploadFileSize = 5000000;
        dialogParameters.FileBrowserContentProviderTypeName = typeof(DBContentProvider).AssemblyQualifiedName;
        DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), dialogParameters);
        imageManager.ClientCallbackFunction = "ImageManagerFunctionPrj";
        imageManager.Width = Unit.Pixel(694);
        imageManager.Height = Unit.Pixel(440);
        DialogOpener1.DialogDefinitions.Add("ImageManager", imageManager);

  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 07 Mar 2012 Link to this post

    Hi Tore,

    Since Q1 2012 ImageManager dialog have a new property ViewMode with default value Thumbnails. In order to change this value for stand-alone dialog you need to use ImageManagerDialogParameters (which inherits FileManagerDialogParameters class) and set the ViewMode property to Grid, e.g.:
    ImageManagerDialogParameters dialogParameters = new ImageManagerDialogParameters();
    dialogParameters.ViewMode = ImageManagerViewMode.Grid;

    Kind regards,
    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.
Back to Top