Click here to Skip to main content
15,899,937 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionindexing service not workiing properly for excel Pin
nikhil12348-Oct-08 20:27
nikhil12348-Oct-08 20:27 
AnswerRe: indexing service not workiing properly for excel Pin
Ashfield8-Oct-08 21:19
Ashfield8-Oct-08 21:19 
QuestionSetting the LoginView's role property using codebehind Pin
Aquardz8-Oct-08 20:22
Aquardz8-Oct-08 20:22 
QuestionAdd provider to sesionState element as we can do with profile and membership Pin
AlexeiXX38-Oct-08 10:57
AlexeiXX38-Oct-08 10:57 
QuestionSQLSession state server Pin
AlexeiXX38-Oct-08 10:33
AlexeiXX38-Oct-08 10:33 
QuestionNeed Help in Coding a GridView(Using Paging) That Display Running Total below it. Pin
RChirumamilla8-Oct-08 10:18
RChirumamilla8-Oct-08 10:18 
AnswerRe: Need Help in Coding a GridView(Using Paging) That Display Running Total below it. Pin
Venkatesh Mookkan8-Oct-08 17:08
Venkatesh Mookkan8-Oct-08 17:08 
GeneralRe: Need Help in Coding a GridView(Using Paging) That Display Running Total below it. Pin
RChirumamilla9-Oct-08 5:58
RChirumamilla9-Oct-08 5:58 
hi Castle rider,
thanks for your reply.can you give code example of your answer. i am giving here more details of my question. i need to display running total of all the textboxes in GridView in the lable at bottom of gridview. this should include textboxes on other pages of gridview too.

<asp:GridView ID="gv_Transaction" runat="server" AutoGenerateColumns="False" Width="80%" HorizontalAlign="Center" CellPadding="4" GridLines="None" ShowFooter="True">
        <FooterStyle  HorizontalAlign="Center"/>
                            <asp:BoundField HeaderText="Employee Name" DataField="Ename" SortExpression="Ename">
                                <ItemStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="SSN" DataField="ssn" SortExpression="ssn" >
                                <ItemStyle Width="80px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Amount" >
                                <ItemTemplate>
                                     $ <asp:TextBox ID="txt_dollar" runat="server" Width="60px" MaxLength="12" style=" text-align:right;" CausesValidation="true" onChange="Add()" /b>gt;</asp:TextBox>
                                    <asp:RegularExpressionValidator ID="reg_dollar" runat="server" ValidationExpression="^\d*\.?(\d{2})$" ErrorMessage="<b>Incorrect Format</b>" SetFocusOnError="true" Display="Dynamic" ControlToValidate="txt_dollar">
                                        <asp:ImageButton ID="img_amt" runat="server" ImageUrl="~/Images/error.gif" AlternateText="Incorrect Format" />
                                    </asp:RegularExpressionValidator>
                             </ItemTemplate>
                                <ItemStyle Width="80px" />
                            </asp:TemplateField>                          
                                                      
                               
                            <asp:BoundField HeaderText="Status" DataField="status" SortExpression="status">
                                <ItemStyle Width="60px" />
                            </asp:BoundField> 
                        </Columns>
    </asp:GridView>


And at bottom i have a label showing total amount
<td style="width:10%; text-align:right; color:#2572a7;">Total Dollar Amount:</td> 
            <td style="width:15%;color:#2572a7; "><asp:Label ID="lbl_TotAmount" runat="server"></asp:Label></td>


I am calling this Javascript function on Onchange Event of Textbox in the grid.that does the addition is
var obj = window.event.srcElement;
 var tBox;

 // clear the sum variable
var sum = 0;

 if(obj.tagName == "INPUT" && obj.type == "text" )
 {
     // Iterate through all the TextBoxes

     tBox = document.getElementsByTagName("INPUT");

     for(i = 0; i< (tBox.length - 2) ; i++)
     {
        if(tBox[i].type == "text")
        {
             if ((parseFloat(tBox[i].value)) && tBox[i].id !="ctl00_ContentPlaceHolder1_payDate_txt_Date" )
             {
                 // The Number function forces the JavaScript to recognizes the input as a number

                 sum += Number(tBox[i].value);

             }
         }
     }

 }
// To Round to Nearest Decimal (i,e to avoid values like 34.999999)
 sum=sum.toFixed(2).toString(10)
  // set the value to the Label Text
 document.getElementById("ctl00_ContentPlaceHolder1_lbl_TotAmount").innerText = sum;


Once again Thanks for your reply...

The Beginer..

QuestionGeneric question about Template web sites.... Pin
Christopher Stratmann8-Oct-08 3:27
Christopher Stratmann8-Oct-08 3:27 
QuestionCursor of n leavel Pin
Member 46590018-Oct-08 2:44
Member 46590018-Oct-08 2:44 
AnswerRe: Cursor of n leavel Pin
Ashfield8-Oct-08 2:48
Ashfield8-Oct-08 2:48 
AnswerRe: Cursor of n leavel Pin
AlexeiXX38-Oct-08 10:36
AlexeiXX38-Oct-08 10:36 
Questionhow to show de data of a text file(csv file)in a grid view Pin
raghvendrapanda8-Oct-08 2:34
raghvendrapanda8-Oct-08 2:34 
AnswerRe: how to show de data of a text file(csv file)in a grid view Pin
Ashfield8-Oct-08 3:30
Ashfield8-Oct-08 3:30 
AnswerRe: how to show de data of a text file(csv file)in a grid view Pin
Venkatesh Mookkan8-Oct-08 17:18
Venkatesh Mookkan8-Oct-08 17:18 
Questionobject data source Pin
arkiboys8-Oct-08 1:46
arkiboys8-Oct-08 1:46 
Questionsave txt file on client computer Pin
Rinki Mukheraji8-Oct-08 1:33
Rinki Mukheraji8-Oct-08 1:33 
AnswerRe: save txt file on client computer Pin
eyeseetee8-Oct-08 2:47
eyeseetee8-Oct-08 2:47 
AnswerRe: save txt file on client computer Pin
Venkatesh Mookkan8-Oct-08 17:27
Venkatesh Mookkan8-Oct-08 17:27 
QuestionCross database compatibility Pin
Bardy858-Oct-08 0:52
Bardy858-Oct-08 0:52 
QuestionAdd control to panel Runtime Pin
omlac7-Oct-08 23:49
omlac7-Oct-08 23:49 
AnswerRe: Add control to panel Runtime Pin
eyeseetee7-Oct-08 23:54
eyeseetee7-Oct-08 23:54 
GeneralRe: Add control to panel Runtime Pin
omlac8-Oct-08 0:07
omlac8-Oct-08 0:07 
QuestionExport Datagrid to Excel using ASP.Net Pin
mullamootil7-Oct-08 23:36
mullamootil7-Oct-08 23:36 
AnswerRe: Export Datagrid to Excel using ASP.Net Pin
HemJoshi7-Oct-08 23:53
HemJoshi7-Oct-08 23:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.