List에서 GridView를 채우면 TemplateField 컨트롤을 사용하여 편집 할 수 밖에 없습니다. 이렇게하려면 편집 모드에서 원래 값으로 채워진 TextBox를 표시하고 FindControl을 사용하여 업데이트 제출시 새 값을 가져와야합니다.GridView에서 FindControl ("someTextBox")이 업데이트 된 값을 보내지 않음
문제 foundTextBox.Text는 "OriginalTextBoxValue"
<asp:TemplateField HeaderText="A Field">
<ItemTemplate>
<asp:Label ID="_theLabel" runat="server" Text='<%# Eval("AField") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="_theTextBox" runat="server" Text='<%# Eval("AField") %>' />
</EditItemTemplate>
</asp:TemplateField>
그리고 당신은 잘못된 이벤트 핸들러의 코드 뒤에있어
TextBox newText = (TextBox)_myGridView.Rows[e.RowIndex].FindControl("_thTextBox");
//newText.Text == the old value of the text box
나는 비슷한 문제를 겪고있다. 그리고 나는 이것이 무슨 일이 일어나고있는 동안, 나는 그것을 고치는 방법을 정말로 모른다. – sylverfyre