P
postings
Hi
In my datagrid I have a textbox in an EditItemTemplate like so
--------------------
<asp:TextBox id=txtPrice ontextchanged="txtPrice_TextChanged"
runat="server" AutoPostBack="True">
--------------------
I also have back end code like this:
--------------------
Sub txtPrice_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Response.Write("BOING!")
'This won't get the textbox controls I need, what should I do?
'Dim txtPrice As TextBox
=MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtPrice")
'Dim txtDiscount As TextBox =
MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtDiscount")
'Dim txtTotal As TextBox =
MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtTotal")
End Sub
--------------------
This code works fine (Note I've remmed out the last three lines).
I basically need to get control of the textbox controls in the edititem
template so I can get their values and update them.
If I take out the rems it won't work (e points to system.eventargs,
not WebControls.DataGridCommandEventArgs). So I need something else.
What code do I need to get control of the textboxes in
edititemtemplate?
Many thanks!
Alex
In my datagrid I have a textbox in an EditItemTemplate like so
--------------------
<asp:TextBox id=txtPrice ontextchanged="txtPrice_TextChanged"
runat="server" AutoPostBack="True">
--------------------
I also have back end code like this:
--------------------
Sub txtPrice_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Response.Write("BOING!")
'This won't get the textbox controls I need, what should I do?
'Dim txtPrice As TextBox
=MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtPrice")
'Dim txtDiscount As TextBox =
MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtDiscount")
'Dim txtTotal As TextBox =
MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtTotal")
End Sub
--------------------
This code works fine (Note I've remmed out the last three lines).
I basically need to get control of the textbox controls in the edititem
template so I can get their values and update them.
If I take out the rems it won't work (e points to system.eventargs,
not WebControls.DataGridCommandEventArgs). So I need something else.
What code do I need to get control of the textboxes in
edititemtemplate?
Many thanks!
Alex