Gridview edit mode

Signaler
Messages postés
7
Date d'inscription
jeudi 30 octobre 2008
Statut
Membre
Dernière intervention
18 novembre 2008
-
Messages postés
240
Date d'inscription
lundi 18 juin 2007
Statut
Membre
Dernière intervention
18 février 2011
-
Bonjour,

j'ai une gridview dont le code est sidessous:

lorsque je load ma page  j'ai deux choix selon une variable session qui va etre soit a mode 
   display alors je doit afficher le mode  ItemTemplate  cad   lblanswer, lblNbrNo et Label1.
  si mode edit le doit afficher le mode  EditItemTemplate cad  lblanswer, rdbYesNo, chkFlague

je ne sais pas comment faire ca stp j'ai besoin d'aide

 
                            <Columns>     
                                           
                                                                                        
                                                                                                    ----

                                                               
                                                      '/>
                                                      ' />
                                                           ,   
                                                                                                     
                                                      
                                                      ----

                                                             
                                                                    ' />
                                                                     ' /> 
                                                        ,
                                                                                                                                                                 
                                                           ,
                                                      
                                                   
 
                                            
                                           
                                                <EditItemTemplate>
                                                                                                        ----

                                                               
                                                      '/>
                                                      ' />
                                                           ,   
                                                                                                      
                                                     
                                                      ----

                                                                                                      
                                                                   
                                                                       
                                                                       
                                                                   
                                                  
                                                           ,
                                                                                                                                  
                                                                                                    
                                                           ,
                                                      
                                                   
                                                 </EditItemTemplate>
                                                                          
                         </Columns>
                               
                           

Merci d'avance
                           
Arouwa

1 réponse

Messages postés
240
Date d'inscription
lundi 18 juin 2007
Statut
Membre
Dernière intervention
18 février 2011

Bonjour Arouwa,
Tu ne peux pas changer le mode d'un gridview en code behind (car un gridview epu avoir plusieurs lignes).
Essaie de passer par un formview qui, lui, n'affiche qu'un seul enregistrement.
le passage d'un mode à l'eutr est réalisé par :
monformview.changemode(formviewmode.update) (change "update" en "insert" ou "readOnly" selon ton besoin).
@+