Input string was not in a correct format. While trying to find difference between two column values on gridview

I’m keep on getting this error when I try to find difference between two columns in a grid and show it on 3rd column.

<asp:TemplateField HeaderText="Issued Quantity"SortExpression="Issued_Quantity">
   <ItemTemplate>
      <asp:Label ID="txtIssued_Quantity" runat="server" Text='<%# ProcessMyDataItem(Eval("Issued_Quantity")) %>'></asp:Label>
   </ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Returned Quantity" SortExpression="Return_Quantity">
   <ItemTemplate>
      <asp:Label ID="txtReturn_Quantity" runat="server" Text='<%# ProcessMyDataItem(Eval("Return_Quantity")) %>'></asp:Label>
   </ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Actual Used Quantity" SortExpression="txtQty1">
   <ItemTemplate>
      <asp:TextBox ID="txtQty" runat="server" Enabled="False" Height="27px" Text='<%# Convert.ToDouble(Eval("Issued_Quantity")) - Convert.ToDouble(Eval("Return_Quantity"))%>' Width="73px"></asp:TextBox>
   </ItemTemplate>
</asp:TemplateField>

Any help greatly appreciated.

Source: New Questions

Leave a Reply