Question : Gridview Update with One Button Dropdownlist Template

I trying to update my gridview with one button. I wrote some code guiding myself from another forums. It shows no error when i launch the page everything is visible the dropdowlist and after i click the Assign Button the gridview Refresh. Heres the code for the gridview and the button.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:

        
        
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                    
                    
                    
                
            
        
        
        
        
        
        
        
    
 
 
'THIS IS THE CODE FOR THE ASSIGN COMMAND
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Assign1.Click
        For Each gvr As GridViewRow In GridView1.Rows
            If gvr.RowType = DataControlRowType.DataRow Then
                Dim strID As String = GridView1.DataKeys(gvr.RowIndex)("ID")
                Dim analistaname As String = CType(gvr.FindControl("Dropdownlist1"), DropDownList).SelectedValue
                ' Call database update method with params
                SqlDataSource1.UpdateParameters("ANALISTA").DefaultValue = analistaname
                SqlDataSource1.Update()
            End If
 
        Next
 
    End Sub

Answer : Gridview Update with One Button Dropdownlist Template

i used update parameters for controls, and also my dropdowlist needed to be bound to the sqldatasource. I works now. Thanks.
Random Solutions  
 
programming4us programming4us