+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Replacing LibraryItemBatchEdit view

Replacing LibraryItemBatchEdit view

3 posts, 0 answered
  1. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    06 Aug 2010
    Link to this post
    Hi,

    I am trying to replace the Telerik.Libraries.WebControls.Admin.LibraryItemBatchEdit view with a custom batch edit view. I added the following lines to the Telerik.Sitefinity.Configuration.ControlsConfig.xml file.



    <viewSettings hostType="Telerik.Libraries.WebControls.Admin.LibraryItemsView, Telerik.Libraries">
                <views>
                    <remove name="LibraryItemBatchEdit"></remove>
                    <add name="LibraryItemBatchEdit" viewType="ResearchAreas.WebControls.Admin.ResearchAreaLibraryItemBatchEdit`1[[Telerik.Libraries.WebControls.Admin.LibraryItemsView, Telerik.Libraries]], ResearchAreas"></add>
                </views>
            </viewSettings>

    However, my custom view does not seem to be replacing the default view. Is this the proper way to replace the batch edit view?

    Thanks in advance,
    Bobby
  2. Bobby
    Bobby avatar
    56 posts
    Registered:
    11 Feb 2009
    06 Aug 2010
    Link to this post
    Hi,

    Please forget the last post. This is my configuration file.

    <viewSettings hostType="Telerik.Libraries.WebControls.Admin.LibraryItemsView, Telerik.Libraries">
                <views>
                    <remove name="LibraryItemEdit"></remove>
                    <remove name="LibraryItemBatchEdit"></remove>
                    <add name="LibraryItemEdit" viewType="ResearchAreas.WebControls.Admin.ResearchAreaLibraryItemEdit, ResearchAreas"></add>
                    <add name="LibraryItemBatchEdit" viewType="ResearchAreas.WebControls.Admin.ResearchAreaLibraryItemBatchEdit, ResearchAreas"></add>
                </views>
            </viewSettings>

     

     

     

     

    The LibraryItemEdit View is being replaced by my custom ResearchAreaLibraryItemEdit view properly. However, my custom batch edit view, i.e. ResearchAreaLibraryItemBatchEdit, is not being used. The following is my custom class

    public class ResearchAreaLibraryItemBatchEdit : LibraryItemBatchEdit<LibraryItemsView>
        {
            public const string batchEditTemplateName = "ResearchAreas.Resources.ControlTemplates.Backend.ResearchAreaLibraryItemBatchEdit.ascx";
      
            public override System.Type LocalizationAssemblyInfo
            {
                get
                {
                    throw new Exception("I'm in my class");
                    return typeof(ResearchAreaLibraryItemBatchEdit);
                }
                set
                {
                    base.LocalizationAssemblyInfo = value;
                }
            }
      
            public override System.Type AssemblyInfo
            {
                get
                {
                    throw new Exception("I'm in my class");
                    return typeof(ResearchAreaLibraryItemBatchEdit);
                }
                set
                {
                    base.AssemblyInfo = value;
                }
            }
      
            protected override string LayoutTemplateName
            {
                get
                {
                    return batchEditTemplateName;
                }
            }
        }

    As you can see, I am throwing an exception just to let me know that my custom code is being called. However, nothing happens. Can you tell me what I am doing wrong?

    Thanks again,
    Bobby

     

     

  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Aug 2010
    Link to this post
    Hi Bobby,

    Thank you for using our services.

    Unfortunately this is an issue with the LibraryItemBatchEdit control. The only way to customize the behavior of the control would be from the control template and/or adding a code file to it. The other option would be to create a module which inherits from the Libraries module and inherit its views to create custom ones.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
3 posts, 0 answered