DataGrid Template Control event processing question

M

Mike Salter

I have a DataGrid that uses Templates (see listing below) in the Footer,
where I add records to the DataGrid. My problem is that I want to trap the
SelectedIndexChanged event of the DropDownList "addItemNumber" in the
template on the server side, so that I can set the default value of another
template TextBox "addUnitPrice" in the footer. To do this I need to
execute some SQL to do a lookup to populate the TextBox. I can see the
PostBack occur in the Page_Load event when I change the DropDownList, but I
don't see any way to trap a specific event for it.

TIA
--
Mike

<FooterTemplate>
<asp:DropDownList id=addItemNumber DataValueField="ItemNumber"
DataTextField="ItemDescr" DataSource='<%# GetValues("Inventory") %>'
Runat="server" AutoPostBack="true" Enabled="true">
</asp:DropDownList>
</FooterTemplate>

<FooterTemplate>
<asp:TextBox ID="addUnitPrice" Runat="server" />
<asp:Button CommandName="Insert" Text="Add" ID="btnAdd" Runat="server" />
</FooterTemplate>
 

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
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top