1
radiobuttonlist는 어떻게 찾을 수 있으며 gridview의 항목입니까? GRIDVIEW 코드 :gridview에서 radiobuttonlist 찾기
<asp:TemplateField HeaderStyle-Width="20px">
<ItemTemplate>
<asp:RadioButtonList ID="rbl_NIU" runat="server" RepeatDirection="Horizontal" BorderStyle="None" BorderWidth="0px" BorderColor="Transparent">
<asp:ListItem Text="N" Value="1" ></asp:ListItem>
<asp:ListItem Text="I" Value="2" ></asp:ListItem>
<asp:ListItem Text="U" Value="3" ></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
과 된 .vb 코드 : 나는 모든하지만 "각 항목에 대해"의 "개체의 인스턴스로 설정되지 않았습니다 객체 참조"얻을 때마다 시도
Protected Sub gvImport_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvImport.RowDataBound
'Dim radio As RadioButtonList = DirectCast(e.Row.FindControl("rbl_NIU"), RadioButtonList)
'Dim radio As RadioButtonList = TryCast(sender, RadioButtonList)
Dim radio As RadioButtonList = CType(e.Row.FindControl("rbl_NIU"), RadioButtonList)
For Each par As Paraugs In list
For Each item As RadioButton In radio.Items
par.Write.ToString()
Next
Next
End Sub
On breakpoint "라디오"는 "Nothing"을 반환합니다.
어디에서 문제가 발생합니까? 도와주세요! 감사합니다.
'list'가 정의? – InSane
e.Row.RowType 유형은 무엇입니까? (DataControlRowType.DataRow 여야 함) –