image of my listview:
http://img26.imageshack.us/img26/4043/listview.png

I want to total every row from my listview

tallies total infected people and percentage
____________________________________________________________________
CityID | City | Population | Male | Female | Total | Percentage |

Population, male, and female columns are user inputs
total column is male+female textbox value per row
percentage= (total/population)*100 also per row
to calculate total and percentage on every textchange

here is my html code:

<asp:ListView ID="ListView1" runat="server">
   <LayoutTemplate>
      <table style="border: solid 2px #336699;" cellspacing="0" cellpadding="3" rules="all">
         <tr style="background-color: #336699; color: White;">

            <th>City</th>
            <th>Population</th>
            <th>Male</th>
            <th>Female</th>
            <th>Total</th>
            <th>%</th>
         </tr>
         <tbody>
            <asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
         </tbody>
      </table>
   </LayoutTemplate>
   <ItemTemplate>
      <tr>
        <td> <asp:Label ID="lblCtyID" runat="server" Text='<%# Bind("CityID") %>' /> </td>
        <td> <asp:Label ID="lblCty" runat="server" Text='<%# Bind("CityName") %>'/> </td>
         <td><asp:TextBox ID="txtPopu" runat="server"/></td>
         <td>
         <asp:TextBox ID="txtMale" runat="server" Width="69px" ValidationGroup="check"/>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" Display="Dynamic" runat="server" ForeColor="Maroon" SetFocusOnError="True" ControlToValidate="txtMale" ErrorMessage="X" ValidationExpression="[0-9]*" ValidationGroup="check"></asp:RegularExpressionValidator>
         </td>
         <td><asp:TextBox ID="txtFemale" runat="server" Width="69px" onpaste = "return false;" onkeyup ="keyUP(event.keyCode)" onkeydown = "return isNumeric(event.keyCode);"/></td>
         <td><asp:TextBox ID="txtTotal" runat="server" enabled="false" Width="85px"/></td>
         <td><asp:TextBox ID="txtPercent" runat="server" enabled="false" Width="85px"/></td>

      </tr>
   </ItemTemplate>
</asp:ListView>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Save Info"
            Width="136px" />
<br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:GeraldConnString2 %>"
            SelectCommand="SELECT [CityID], [CityName] FROM [Cities]"></asp:SqlDataSource>

Hi

This is very easy and good code for text box in list view and perform calculations in java script. It will help me in my system.thanks for giving me and helping me out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.