I have a gridview which is pulling some data from a database. One of the columns shows an exchange rate, so 1.54 for example. Above the gridview I have a text box that allows an amount to be entered, 500 for example.
I want to be able to have a column in the gridview that says ‘500 is’ where 500 is taken from the textbox and then the row in the grid to show 500 * 1.54.
My textbox is:
<asp:TextBox id="CustomerAmount" runat="server" value="500" Width="73px"></asp:TextBox>
My gridview value I wish to multiply this by is:
<asp:BoundField DataField="Rate" HeaderText="Rate" SortExpression="Rate" dataformatstring="{0:F4}">
<HeaderStyle BackColor="#1686D6" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
Any ideas, I’m stuck on this.
To set the header (suppose 1 is the column index):
To set the cells data add a template column:
Make sure the textbox is not empty (has initial int value).