2012-10-13 4 views
0

아래 코드를 사용하여 단추 상태 (사용 또는 사용 안 함)를 변경하고 있습니다. 그러나 그것은 첫 번째 컨트롤을 위해 작동하고 두 번째 및 세 번째 컨트롤 상태는 변경되지 않았습니다. 이 오류를 해결하도록 도와주세요.데이터 목록 항목 데이터가 제대로 작동하지 않습니다.

If (e.Item.ItemType = DataControlRowType.DataRow) Then 
      Dim status As Button = CType(e.Item.FindControl("btnstatus"), Button) 
      If status IsNot Nothing Then 
       If status.Text = "Ready" Then 
        status.Enabled = True 
       ElseIf status.Text = "Assigned" Then 
        status.Enabled = False 
       Else 
        status.Enabled = False 
       End If 
      End If 

      'do what ever you want to do here using the value of your label 
     End If 

답변

0

이 시도 :

If e.Item.ItemType = ListItemType.Item Or _ 
      e.Item.ItemType = ListItemType.AlternatingItem Then 

//Your Code Here 

End If 
관련 문제