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>
<aspropDownList id=addItemNumber DataValueField="ItemNumber"
DataTextField="ItemDescr" DataSource='<%# GetValues("Inventory") %>'
Runat="server" AutoPostBack="true" Enabled="true">
</aspropDownList>
</FooterTemplate>
<FooterTemplate>
<asp:TextBox ID="addUnitPrice" Runat="server" />
<asp:Button CommandName="Insert" Text="Add" ID="btnAdd" Runat="server" />
</FooterTemplate>
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>
<aspropDownList id=addItemNumber DataValueField="ItemNumber"
DataTextField="ItemDescr" DataSource='<%# GetValues("Inventory") %>'
Runat="server" AutoPostBack="true" Enabled="true">
</aspropDownList>
</FooterTemplate>
<FooterTemplate>
<asp:TextBox ID="addUnitPrice" Runat="server" />
<asp:Button CommandName="Insert" Text="Add" ID="btnAdd" Runat="server" />
</FooterTemplate>