Implementing cascading DropDownList binding in a templated control

后端 未结 4 573
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 04:21

I have 2 DropDownList controls on my form, the second of which uses the SelectedValue of the first as one of its binding parameters.

Both <

4条回答
  •  走了就别回头了
    2021-01-03 04:54

    Actually I'm posting this answer in case anybody else got stuck like I did. What Muhammad Akhtar said works perfectly, however I found a simpler solution.
    In

    
    

    change Bind("AttorneyID") to DataBinder.Eval (Container.DataItem, "AttorneyID")
    It works perfectly!
    EDIT: My sample code:

    
    
        
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                        
                    
                
            
            
                
                    
                
                
                    
                        
                    
                    
                        
                            
                        
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                     
                
                
                    
                     
                
                
                    
                
            
        
    
    
        
            
        
        
            
            
            
            
            
        
        
            
        
        
            
            
            
            
            
            
        
    
    
    

提交回复
热议问题