in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

ASPxTreeList & Sharepoint Smart Part

Last post 10/30/2008 8:23 AM by Joel Mundt. 2 replies.
Page 1 of 1 (3 items)
Sort Posts:
Previous Next
  • 10/29/2008 4:22 PM

    ASPxTreeList & Sharepoint Smart Part

    I'm evaluating the ASPxTreeList Suite and was wondering if anyone has tried successfully to make the control work in a Sharepoint AJAX-enabled Smart Part.  I have a project for which ASPxTreeList appears to be the perfect solution, but I need to deliver it in MOSS 2007.  I realize that the DevExpress people don't currently support such an implementation and I believe I read that they're working on Sharepoint-compatible controls, but I'm up against a 2-month time crunch and was hoping...

    TIA!!

    Regards, Joel

  • 10/29/2008 6:51 PM In reply to

    Re: ASPxTreeList & Sharepoint Smart Part

    Never mind...I think I got my mini-demo up and working...I think.  I have to run this evening, but will post process tomorrow.  Yay me!!!

    Regards, Joel

  • 10/30/2008 8:23 AM In reply to

    Re: ASPxTreeList & Sharepoint Smart Part

    In case anyone else wants to experiment with it:

    I created an ASP.NET Web App in VS2008, to which I added a Web User Control.  The ASCX file looks as follows:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TreeTest1.ascx.cs" Inherits="TreeTest1.TreeTest1" %>

    <%@ Register Assembly="DevExpress.Web.ASPxTreeList.v8.2, Version=8.2.6.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1" Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dxwtl" %>

    <%@ Register Assembly="DevExpress.Data.v8.2, Version=8.2.6.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1" Namespace="DevExpress.Data" TagPrefix="dxwtl" %>


    <dxwtl:ASPxTreeList ID="testList" runat="server" Width="100%">
       <Columns>
          <dxwtl:TreeListTextColumn FieldName="Name">
             <PropertiesTextEdit EncodeHtml="false" />
          </dxwtl:TreeListTextColumn>
       </Columns>
    </dxwtl:ASPxTreeList>


    The code behind file looks as follows:

    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using DevExpress.Web.ASPxTreeList;
    using DevExpress.Data;
    using PorkBoard.InternalSystems;

    namespace TreeTest1 {

       public partial class TreeTest1 : System.Web.UI.UserControl {

          protected void Page_Load( object sender, EventArgs e ) {
             CreateNodes();
          }

          void CreateNodes() {

             // First main node.
             TreeListNode CriticalIssue1 = CreateNodeCore( 1, "<b>1. Node 1</b>", null );

             // Sub node.
             TreeListNode DesiredOutcome1 = CreateNodeCore( 2, "1. Sub-node 1.", CriticalIssue1 );

             // Sub-sub node.
             CreateNodeCore(3, "1. Sub-sub-node 1", DesiredOutcome1 );

             // Second main node.
             TreeListNode CriticalIssue2 = CreateNodeCore( 4, "<b>2. Node 2.</b>", null );
          }

          TreeListNode CreateNodeCore( object key, string text, TreeListNode parent ) {
             TreeListNode node = testList.AppendNode( key, parent );

             node["IconName"] = "";
             node["Name"] = text;

             return( node );
          }
       }
    }

    Built it, then dropped the ASCX & ASCX.cs files into the UserControls directory (that's what AJAX SmartParts require) on the Sharepoint side.  Edit the ASCX file, changing the word "CodeBehind" to "CodeFile".

    I then installed the following 4 DLL's into the GAC: DevExpress.Data.v8.2, DevExpress.WEb.ASPxEditors.v8.2, DevExpress.Web.ASPxTreeList.v8.2, & DevExpress.Web.v8.2.

    If your AJAX SmartPart install was done correctly, you should be able to add one to the Web Part page, then modify it.  In the "User Controls to Display" drop-down, your Web Part should be there as (in my case) usercontrols_treetest1_ascx.  Drop it in the Web Part bucket and away you go.

    Hopefully someone will find this helpful...I found it challenging (but very satisfying to get it to work).  I'm just using the eval version right now, but I'm really impressed with these controls so far.

    Regards,
    Joel

     

     

     

     

     

Page 1 of 1 (3 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED