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

Forums / Developing with Sitefinity / should have atleast one ViewMode defined! Error

should have atleast one ViewMode defined! Error

6 posts, 1 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    28 Jun 2011
    Link to this post
    Hi,

    I have been developing a custom module and have been using the products module side by side, i managed to compile it, get it installed and clean up some errors which were caused by me, but i am little bit stumped with this one?  I am getting it when trying to view the listings page for my module in the backend admin.

    The MasterView's Definition should have atleast one ViewMode defined!
    Parameter name: IMasterViewDefinition.ViewModes


    I thought i defined all the backend views in the Definitions file in the module itself via code, as i didnt see any "backend" views defined as anything within the code.  Can anyone please shed some on light on what i am sure i have missed so i can get this baby up and running.

    Thank you,

    Rob
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    30 Jun 2011
    Link to this post
    Hi Roberto Modica,

    This error is thrown, because there's no ViewMode defined for the backend master view. This is done from the definitions, and the specific code in the Products module, which does it is the following:

    var gridMode = new GridViewModeElement(productsGridView.ViewModesConfig)
    {
        Name = "Grid"
    };
    productsGridView.ViewModesConfig.Add(gridMode);

    Please make sure that you have this correctly in your definitions.  Kind regards,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    30 Jun 2011
    Link to this post
    Hi Slavo,

    Thank you, i raised a support ticket for this and Pepe steered me in the right direction, however' although the error has gone i am reciving a blank screen and using firebug there is a hidden div with the words "Error Parsing the Template" so i am not sure what i am doing wrong here.

    I have attached the project to the support ticket, do i need to remove the module and reinstall it?

    Rob
  4. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    05 Jul 2011
    Link to this post
    Hi Roberto Modica,

    Where do you receive the blank screen? Are you again talking about the module's backend? Do you have any custom controls except the definitions, whose templates might be causing this? The error is definitely an error with some control template, but please tell me where to look for the error?

    All the best,
    Slavo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    05 Jul 2011
    Link to this post
    Hi Slavo,

    I have resolved the issues, but the error parsing template was not it, i was mistaken, i knew i was missing some code that was causing it, the problem was caused by missing the SetRootPermissions method in my DataProvider class.  I knew i had made a mistake in the code, but the problem was i coudnt find it, in these instances i would love for the site to blow up in a huge explosion of error messages so that i knew i had missed it, otherwise it is just pure trail and error.

    Thanks for taking the time to look at my post.

    Rob
  6. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    08 Jul 2011
    Link to this post
    Hi Roberto Modica,

    I'm glad you resolved the problem. We'll think about a way to make errors in the code more clear in the messages. Sometimes exceptions are not possible because the code causes client-side errors, but we are constantly working to improve the developer experience. Let us know of anything else that comes up.

    Best wishes,
    Slavo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

6 posts, 1 answered