CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
   Explore    Item Entry    Profile    Invite   History    Resources   SiteMap  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML




Zone: > newsgroup > asp.net forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 9/8/2006 4:09:17 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
Russ Helfand
Asp.Net User
Instructions for using the TreeView adapter9/8/2006 4:09:17 PM

0/0

The beta 2 release of the CSS Friendly ASP.NET 2.0 Control Adapter kit supports more sophisticated features for the TreeView than previous releases.  There are, however, a few limitations:

SelectedNodeChanged

If you wish to handle the TreeView's SelectedNodeChanged event, you must add a new attribute called OnAdaptedSelectedNodeChanged to your <asp:TreeView> tag. Set OnAdaptedSelectedNodeChanged equal to the name of a PUBLIC (!!!) function of your page that acts as the event delegate. Typically, you will end up with like this:

<script runat="server">
    public void OnClick(Object sender, EventArgs e)
    {
        // do something with foobar.SelectedNode
    }
</script>
<asp:TreeView ID="foobar" runat="server" OnSelectedNodeChanged="OnClick" OnAdaptedSelectedNodeChanged="OnClick" />


TreeNodeCheckChanged

The TreeNodeCheckChanged event is handled by the adapter in a fashion that parallels the SelectedNodeChanged event. In other words, when using the TreeView adapter, you should add OnAdaptedTreeNodeCheckChanged as a TreeView tag attribute and it should be set to the name of a PUBLIC function in the page that handles the event.

<script runat="server">
    public void OnCheckChanged(Object sender, TreeNodeEventArgs e)
    {
        // do something with e.Node
    }
</script>
<asp:TreeView ID="foobar" runat="server" OnTreeNodeCheckChanged="OnCheckChanged" OnAdaptedTreeNodeCheckChanged="OnCheckChanged" ShowCheckBoxes="Leaf">

To reiterate, to handle the TreeView's SelectedNodeChanged or TreeNodeCheckChanged events you must use a new attribute called OnAdapted[eventname].  And that attribute must be set to the name of a public (not protected) function that belongs to the page owns the TreeView.

Interestingly, the adapted Treeview handles the TreeNodePopulate event normally so you do not need to add any special attribute like OnAdaptedTreeNodePopulate to handle it.  You can use the typical OnTreeNodePopulate attribute or set the delegate programmatically.  Further, the delegate function need not belong to the page and can be protected, if you like.


Russ Helfand
Groovybits.com
1 Items, 1 Pages 1 |< << Go >> >|


Search This Site:

Other Resources:

adapters & detailsview - microsoft_downloads ... Please post some code or instructions on how exactly to duplicate the problem. ... Control Adapters - Issue Tracker : When using the CSS control adapter for the ...
White Paper: ASP.NET 2.0 CSS Friendly Control Adapters 1.0 For example, the screenshot below shows a portion of this kit's TreeView adapter ... When using the adapter, you may optionally include the new ...
Adding Adapter Metadata to a BizTalk Project For specific instructions on using the wizard with the SQL adapter, see Adding ... a set of available services from the tree view, and then click Finish. ...
Adapter causes page to fail W3C validation check - ASP.NET Forums I'm using the CSS Friendly Control Adapter in my project to make my treeview W#C ... to get around this for the main menu and hopefully these instructions will help: ...
Inchoate Curmudgeon " Blog Archive " Using JDBC Connection Pools with ... You should follow the standard instructions for installing and configuring ... The missing step is intentional as the pure Ruby adapter works fine for MySQL ...
How to Add Adapter Metadata to a BizTalk Project Use the Add Adapter ... For specific instructions on using the wizard with the SQL adapter, ... of available services from the tree view, and then click Finish. ...
22-COMM-C ControlNet Adapter Firmware v1.004 Follow the instructions in the. appropriate section below. Using DriveExplorer Lite/Full ... adapter. 2. In the DriveExecutive treeview, click on 22-COMM-C. ...





 
All Times Are GMT