1
ASP.net을 사용 중입니다. 4. OnRowDataBound 이벤트를 사용하여 행의 각 셀 값을 루프하고 읽는 방법은 무엇입니까?셀을 통한 GridView OnRowDataBound 루프
감사합니다.
ASP.net을 사용 중입니다. 4. OnRowDataBound 이벤트를 사용하여 행의 각 셀 값을 루프하고 읽는 방법은 무엇입니까?셀을 통한 GridView OnRowDataBound 루프
감사합니다.
아마도 다음과 같은 접근 방식이 도움이 될 것입니다.
마크 업 :
<asp:GridView id="testGrid" OnRowDataBound="testGrid_RowDataBound" ... runat="server">
......
</asp:GridView>
코드 숨김
protected void testGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
string val = string.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach(TableCell cell in e.Row.Cells)
val = cell.Text;
}
}
- 파벨