should have atleast one ViewMode defined! Error

Posted by Community Admin on 04-Aug-2018 18:03

should have atleast one ViewMode defined! Error

All Replies

Posted by Community Admin on 28-Jun-2011 00:00

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

Posted by Community Admin on 30-Jun-2011 00:00

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

Posted by Community Admin on 30-Jun-2011 00:00

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

Posted by Community Admin on 05-Jul-2011 00:00

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 >>

Posted by Community Admin on 05-Jul-2011 00:00

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

Posted by Community Admin on 08-Jul-2011 00:00

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 >>

This thread is closed