Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Tous les projets des élèves ingénieurs de Supinfo



Projets
  Dernier Projet
  Les plus populaires
  Tous les Projets

134 Visiteurs
3168 Projets


My Supinfo-Projects

   Connectez-vous
   Créez un Compte


Synopsis

   118 Visites
   Note INTERNET : 14
    (5 Votants)
   5 Commentaires

   Lire l'article

Evaluez cet article

20
18
16
14
12
10
8
6
4
2
0


Commentez cet article

Auteur :

Email :

Votre commentaire :



 
2005 - Note de Synthèse Stage
TreeView width ASP.NET V2 – Whidbey
[20 mn de lecture - paru le 11/17/2004 3:27:26 PM - Public : Débutant]

Auteur

degrem_mMichel DEGREMONT
Elève-Ingénieur Supinfo Paris
Promotion SUPINFO 2006

   Lui écrire
   Tous les projets de cet auteur
   Le mini-CV de cet auteur

2. Basic using from TreeView

2.1. Simple TreeView 

Now that you can handle Control, we will discover in this chapitre les various events of this control.

Edit TreeView 

>Client1
>>Dossier1
>>>>Facture1
>>>>Facture2
>>Dossier2
>>>>Facture1
>>>>Facture2
>Client2
>>Dossier1
>>Dossier2

You must obtain :

<asp:TreeView ID="TreeView1" ExpandDepth="0" Runat="Server" ShowLines="True">
<Nodes>
   <asp:TreeNode Value="Marque 1" Expanded="True" Text="Client 1">
      <asp:TreeNode Value="Dossier 1" Expanded="True" Text="Dossier 1">
         <asp:TreeNode Value="Facture 1" Text="Facture 1">
         </asp:TreeNode>
         <asp:TreeNode Value="Facture 1" Text="Facture 2">
         </asp:TreeNode>
      </asp:TreeNode>
      <asp:TreeNode Value="Dossier 2" Text="Dossier 2">
      </asp:TreeNode>
   </asp:TreeNode>
   <asp:TreeNode Value="Marque 2" Expanded="True" Text="Client 2">
      <asp:TreeNode Selected="True" Value="Dossier 1" Text="Dossier 1">
      </asp:TreeNode>
      <asp:TreeNode Value="Dossier 2" Text="Dossier 2">
      </asp:TreeNode>
    </asp:TreeNode>
</Nodes>
</asp:TreeView>

After debug. 

TreeView asp.net V2 whidbey

2.2. Event SelectedNodeChanged

The architecture of your TreeView is drawn. We now will create an event with each clicks.

To slip a Label into the Design mode.
To select controls it TreeView, in the properties click on Events .

TreeView asp.net V2 whidbey

You arrive in the properties of control. Double clicked on in the SelectNodeChanged box. You must arrive directly in code-behind.

TreeView asp.net V2 whidbey

  The event is to create. We will post the text contained in the selectionné node.

void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
Label1.Text = TreeView1.SelectedNode.Text;
}

In your treeView you must have a property moreover :

<asp:TreeView
ID="TreeView1"
ExpandDepth="0"
OnSelectedNodeChanged="TreeView1_SelectedNodeChanged"
Runat="Server" ShowLines="True">

2.3. Event TreeNodeCollapsed

If you wish to set up an event with each time the node of TreeView is closed again, you must follow the same principle as above, but in double clicking on the TreeNodeCollapsed event.

2.4. Event TreeNodeExpanded

If you wish to set up an event with each time the node of TreeView is spread, you must follow the same principle as above, but in double clicking on the TreeNodeExpanded event.

 



Articles de la même catégorie

 Pages : Top


47 Visites
0 Commentaires
Introduction to COM
[10 mn de lecture - paru le 11/17/2004 3:06:03 PM - Public : Expert]

En savoir plus


77 Visites
0 Commentaires
Programming with GTK# and Mono
[40 mn de lecture - paru le 11/17/2004 2:31:35 PM - Public : Confirmé]

En savoir plus


65 Visites
0 Commentaires
Plugins management in PHP
[30 mn de lecture - paru le 11/17/2004 2:01:04 PM - Public : Expert]

En savoir plus

   Tous les Articles


SUPINFO Training Center peut vous proposer une formation ...

   Devenez Ingénieur Système Microsoft en 35 jours avec SUPINFO Training Center
   Devenez Certifiés Cisco en 13 jours avec SUPINFO Training Center
   Devenez Administrateur Système Microsoft avec SUPINFO Training Center
   Devenez Développeur Microsoft .NET en 13 jours avec SUPINFO Training Center



Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :