Get controls values upon auto-postback of another control inside DataGrid

P

postings

Hi

This is edited from post from a while back, there's still something I
need to find an answer for (boy datagrids are a headache when you first
start out doing something out of the norm eh :).

Could anybody help please? Here we go then....

In my datagrid I have a few textbox controls in an EditItemTemplate
like so:

----------------------------------------
<asp:TextBox id=txtPrice ontextchanged="txtPrice_TextCh­anged"
runat="server" AutoPostBack="True">
<asp:TextBox id=txtDiscount runat="server" %>'>
<asp:TextBox id=txtTotal runat="server" %>'>
----------------------------------------

I also have back end code like this:

----------------------------------------
Sub txtPrice_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim txtPrice As TextBox = CType(sender, TextBox) 'Thanks to Scott
Mitchell for this

Dim txtDiscount As TextBox = 'Where do I get this control value?
Dim txtTotal As TextBox = 'Where do I get this control value?

End Sub
----------------------------------------

As you can see the subroutine is trigger by the ontextchanged of
txtPrice

I now need to get the values of a textbox inside the datagrid
(txtDiscount), and update the value of another textbox inside the
datagrid (txtTotal), from this same subroutine which is triggered by
autopostback (unless there is another way).

How can I get the values of these other controls from the datagrid?

(I can't use
MyDataGrid.Items(e.Item.ItemIndex).FindControl("txtDiscount") and
"sender" only passes over values from txtPrice and no other controls.
I'm stumped!).

Many thanks....!

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top