Adding UserControls to Admin view

Hi,

How do I add User Controls to the tree node in the admin view?

If I’m not mistaken, I believe that the GenerateOverviewUserControl creates an overview page that acts as the tree node, with user controls added as child nodes to this. However, I’m still unsure how to achieve this by adding custom pages to the node.

     public override ItemNodeUserControl GenerateOverviewUserControl()
     {
         return new OverviewPage();
     }

I wonder if the best way for you to see is to see a sample plugin using this.

Multiple plugin samples use this but I can point to the Video Preview sample.

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/videopreview/readme.html&tree=tree_1.html

I found much to my surprise that a new plugin created with the template does not include this function.

I did a little experiment, created a new plugin “rawTemplate” using the MIPPlugin template. Then in the rawTemplateItemManager I added:

public override ItemNodeUserControl GenerateOverviewUserControl()
{
	return
		new VideoOS.Platform.UI.HelpUserControl(
			rawTemplateDefinition.TreeNodeImage,
			"rawTemplate",
			"Here you can place help on the top node.");
}

Maybe you could learn from repeating my experiment.

If my answer does not fit, perhaps there is more to your question, then please elaborate. Perhaps include what you have done, what you have observed, and what is missing for the solution you are trying to achieve.

Hi @Bo Ellegård Andersen (Milestone Systems)​ ,

Thank you for the feedback. If I understand correctly, the GenerateOverviewUserControl creates the overview page as the top node, with any created items appearing as child items. Given this, is it possible to create “UserControls” or “Pages” at startup rather than adding items first and then generating the UI for those items?

AdminView

In the above Image I created two Items by “Righ-click > Add New” but let’s say I don’t want the user to be able to have this functionality but only to see the ones I created.

Example:

  • OverviewPage
    • Page1
    • Page2

I hope this makes more sense to what I’m trying to achieve.

Another question would be how do I disable the “Righ-click > Add New” functionality or remove the “SideBar/SidePanel” and have a default UserControl

**UPDATE**

Within the definition, I noticed that you can modify the following to eliminate the side panel. (I’m not certain if this represents best practice.)

 ItemsAllowed.One

Using ItemsAllowed.One together with GenerateDetailUserControlList, you can have a multiple tabs with different configuration.

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_admin_1_1_item_manager.html&tree=tree_search.html?search=detailusercontrollist

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_admin_1_1_detailed_user_control.html&tree=tree_search.html?search=detailusercontrollist

Hi @Bo Ellegård Andersen (Milestone Systems)​

Does GenerateDetailUserControlList() return a list created GenerateDetailUserControl()?

I tried something like:

public override List<DetailedUserControl> GenerateDetailUserControlList()
{
            List<DetailedUserControl> detailedUserControls = new List<DetailedUserControl>();
            detailedUserControls.Add(new Page1());
            detailedUserControls.Add(new Page2());
            return detailedUserControls;
 }
 

but does not seem to insert tabs at the bottom of the GenerateOverviewUserControl page.

Am I using it wrong ?

I found the time to test a bit myself. I find that GenerateDetailUserControlList is not called unless I specify ItemsAllowed.Many

I suspect this is the current design. I will consult Milestone developers and have a deeper investigation, this might take a little time.

@Bo Ellegård Andersen Thank you very much

Long story short, the GenerateDetailUserControlList is not called unless I specify ItemsAllowed.Many.

Milestone Development has decided to change this so that a list, DetailedUserControls, can be used together with ItemsAllowed.One in future versions. This will be in MIP SDK 2025R2. It is important to note that it will then require that the Management Client is 2025R2 or newer.

If you want to use this now, and perhaps also have a plugin that is backwards compatible with versions that are a little older, our recommendation is not to use DetailedUserControls but instead develop one user control which has multiple tab using TabControl Class (System.Windows.Forms) or similar.

Hi @Bo Ellegård Andersen (Milestone Systems)​ ,

Noted. Thank you very much for getting back to me.