When I add a Command Field (Edit, Update image button type) handly. The OnRowUpdating doesn't fire when I click on Update button.
Then I change by delete the Command Fiel I've created and use AutoGenerateEditButton property of the GridView and it does work. The function OnRowUpdating does fire.
But I've got another trouble with this way.
I can't get the changed value of the textbox in editting mode.
Here is my code:
Expand|Select|Wrap|Line Numbers
- <asp:GridView ID="grvDsMatHang" runat="server"
- AutoGenerateColumns="true" AllowPaging="True"
- PageSize="5" Width="98%"
- OnRowCancelingEdit="grvDsMatHang_RowCancelingEdit"
- OnRowEditing="grvDsMatHang_RowEditing"
- OnRowUpdating="grvDsMatHang_RowUpdating"
- AutoGenerateEditButton="true"
- AutoGenerateDeleteButton="true" >
Expand|Select|Wrap|Line Numbers
- <EditItemTemplate>
- //my TextBox in editting mode
- <asp:TextBox ID="txtTenMH" runat="server" Text='' idth="50px"></asp:TextBox>
- <asp:HiddenField ID="hdnMoTa" runat="server" Value='<%# DataBinder.Eval(Container,"DataItem.MOTA") %>' />
- </EditItemTemplate>
Expand|Select|Wrap|Line Numbers
- String n_Ten_MH = (row.FindControl("txtTenMH") as TextBox).Text;
Thanks in advance for noting my problems