0
내 asp.net 3.5 응용 프로그램 [C#]에서 gridview 있습니다. 어떤은 다음과 같습니다asp.net의 코드 배후에서 gridview 업데이트
<asp:GridView CssClass="grid_table" ID="GridView1" AllowPaging="true" PageSize="10"
AutoGenerateEditButton="true" ShowHeader="true"
AutoGenerateDeleteButton="true" DataKeyNames="studentId" runat="server"
OnRowEditing="GridView1_RowEditing"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowDeleting="GridView1_RowDeleting"
OnRowUpdating="GridView1_RowUpdating"
onpageindexchanging="GridView1_PageIndexChanging" onrowupdated="GridView1_RowUpdated"
>
<EmptyDataTemplate>
<asp:Label ID="lblNoRecord" runat="server" Text="No Record Found" ForeColor="Red"> </asp:Label>
</EmptyDataTemplate>
</asp:GridView>
을 지금의 RowUpdating 이벤트에서, 나는 아래의 코드를 작성하고이에
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int mytext = Convert.ToInt16(GridView1.Rows[e.RowIndex].Cells[1].Text);
string cConatiner = GridView1.Rows[e.RowIndex].Cells[4].Text;
}
을 myText를이 1 열 즉하지만 때, 나에게 정확한 값을주고있다 셀 값을 1,2,3,4,5,6으로 변경하면 비어 있습니다.
잘못하고 있습니까?
도와주세요.
미리 감사드립니다.
도와주세요. 솔루션을 찾을 수 없습니다. – Zerotoinfinity
당신의 cConatiner는 항상 비어 있습니다. 그것은 당신의 문제입니까? DB/(다른 소스)에서 가져온 데이터를 확인 했습니까? – chapluck
데이터 집합에서 내 gridview 바인딩 오전 및 gridview 9 열 및 16 행을 보여줍니다, 셀 값을 가져올 수 없습니다. – Zerotoinfinity