Hi. I'm using vs2008. I have a gridview that has been set to allow editting on all rows for one template field. I am trying not to have a Edit/Update button. I would like the user to be able to enter the new amount and tab down to the next row. I am trying to catch the new amount on a textchanged event. My problem is that I can't seem to get the current row. I can find examples that use C+ but not vb.net code. Here is my code:
<asp:TemplateField HeaderText="NewInventory"
SortExpression="NewInventory">
<EditItemTemplate>
<asp:TextBox ID="NewInventory" runat="server" AutoPostBack="true"
Text='<%# Bind("NewInventory") %>'>
</asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:TextBox ID="NewInventory" runat="server"
OnTextChanged="UpdateNewQty" AutoPostBack="True"
Text='<%# Bind("NewInventory") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Protected Sub UpdateNewQty(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim strQty As String
Dim row As GridViewRow = (current row)
Dim txtQty As TextBox = (value in NewInventory textbox)
strQty = (value in NewInventory textbox)
Catch ex As Exception
End Try
End Sub
I appreciate any help that you can give me. I have been searching the web for code examples, but I'm getting greyer by the minute!
Thanks
Cathy
<asp:TemplateField HeaderText="NewInventory"
SortExpression="NewInventory">
<EditItemTemplate>
<asp:TextBox ID="NewInventory" runat="server" AutoPostBack="true"
Text='<%# Bind("NewInventory") %>'>
</asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:TextBox ID="NewInventory" runat="server"
OnTextChanged="UpdateNewQty" AutoPostBack="True"
Text='<%# Bind("NewInventory") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Protected Sub UpdateNewQty(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim strQty As String
Dim row As GridViewRow = (current row)
Dim txtQty As TextBox = (value in NewInventory textbox)
strQty = (value in NewInventory textbox)
Catch ex As Exception
End Try
End Sub
I appreciate any help that you can give me. I have been searching the web for code examples, but I'm getting greyer by the minute!
Thanks
Cathy