4 Replies Latest reply on Aug 23, 2012 8:34 AM by Asle Frantzen

    AF TreeView in ASP (Visual Studio 2010)

    fj.villasmil

      I have a question.: Is possible to use the AF Tree View in a ASP Page. i am trying to use the Osi Tools for Visula Studio 2010, but only appear for Windows Form no for Web page.

       

      In case afirmative, could you to explain me like to implement it? 

        • Re: AF TreeView in ASP (Visual Studio 2010)
          cmanhard

          It is not possible.  The AF Treeview control is designed for Windows Form use only.

          • Re: AF TreeView in ASP (Visual Studio 2010)
            mhamel

            @Fernando: The AFTreeView class inherits from the TreeView one which is a Windows form only component. Although, nothing prevents you to write your own one if you have enough time.

             

            Can you elaborate more on your use case? We have many products and data access products that have connectivity with PI AF that can surely help you.

              • Re: AF TreeView in ASP (Visual Studio 2010)
                Asle Frantzen

                If you decide to take the time to implement this, I have a few pointers.

                 

                If you start with the component System.Web.UI.WebControls.TreeView, you can take it pretty far untill you notice that when it comes to AJAX capabilities this is pretty useless.

                 

                Then you'll need to download "The CSS Friendly Control Adapters kit" from cssfriendly.codeplex.com and make use of the TreeViewAdapter.cs file, to "AJAX enable" the component.

                 

                Third step would obviously be getting data into the component, and that wouldn't be too much of a hassle if you've used the AF SDK before.

                 

                 

                 

                Are you required to go ASP.net only, or can you possibly use Sharepoint to host your page? If so, you can use the PI TreeView webpart to provide the data you need, out of the box.

                 

                 

                 

                If you're not using Sharepoint in your intranet pages (I assume it's intranet), you'll most likely have the free version of Sharepoint (either Windows Sharepoint Services 3.0 or Sharepoint Foundation 2010) included with some Windows server you're using. If you set it up you can host PI Webparts there, and bring them into your ASP.net page using the iframe functionality of html. I have described this process thoroughly in my blog post here: vcampus.osisoft.com/.../using-pi-webparts-in-non-sharepoint-environments.aspx