Chris Johnson

Chris Johnson

  • NA
  • 41
  • 4.5k

Adding Columns in a Gridview

Feb 12 2021 2:09 PM
Hi all.
 
I hope someone can help me.
 
I have a gridview with 6 Columns. Firstly I added the sixth using a template field "Available".
 
<Columns>
<asp:BoundField DataField="ITNOLQ" HeaderText="Item Number" SortExpression="ITNOLQ" />
<asp:BoundField DataField="WHLCLQ" HeaderText="Location" SortExpression="WHLCLQ" />
<asp:BoundField DataField="QLOHLQ" HeaderText="Quantity" SortExpression="QLOHLQ" />
<asp:BoundField DataField="QLALLQ" HeaderText="Allocated" SortExpression="QLALLQ" />
<asp:BoundField DataField="ORDRLQ" HeaderText="Order Number" SortExpression="ORDRLQ" />
<asp:TemplateField HeaderText="New Count" ItemStyle-HorizontalAlign="Center" >
<ItemTemplate>
<asp:TextBox ID="Available" Width="20" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
 
Simply I wish to do a sum QLOHLQ - QLALLQ and display that in the Available template field.
 
I have trawled the web and there seem to be a miriad of ways of doing this and I'm at the point of confusion.
 
Could someone possibly help me please? 

Answers (4)