Click here to Skip to main content
15,860,972 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Web Application Pin
Christian Graus8-Nov-09 23:29
protectorChristian Graus8-Nov-09 23:29 
GeneralRe: Web Application Pin
Swati_g19858-Nov-09 23:43
Swati_g19858-Nov-09 23:43 
GeneralRe: Web Application Pin
sashidhar9-Nov-09 0:13
sashidhar9-Nov-09 0:13 
QuestionRedirect from one page of a one project to another page of another project in same solution Pin
getaccessyr8-Nov-09 23:24
getaccessyr8-Nov-09 23:24 
AnswerRe: Redirect from one page of a one project to another page of another project in same solution Pin
Nishant Singh8-Nov-09 23:26
Nishant Singh8-Nov-09 23:26 
AnswerRe: Redirect from one page of a one project to another page of another project in same solution Pin
padmanabhan N8-Nov-09 23:30
padmanabhan N8-Nov-09 23:30 
GeneralRe: Redirect from one page of a one project to another page of another project in same solution Pin
getaccessyr8-Nov-09 23:36
getaccessyr8-Nov-09 23:36 
Questiontotal and subtotal in gridview footer Pin
RajpootRohan8-Nov-09 23:08
professionalRajpootRohan8-Nov-09 23:08 
Hello friends,

I have to display subtotal, vat,total in gridview footer. I am doing like this but nothing is displayed.
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" <br />
                    CellPadding="4" Font-Names="Verdana" Font-Size="Small" ForeColor="#333333" <br />
                    PageSize="900" Width="600px" EmptyDataText="No items in your cart!!" <br />
                    DataKeyNames="REF" GridLines="None" ShowFooter="True" <br />
                    onrowdatabound="GridView1_RowDataBound"><br />
                    <FooterStyle BackColor="#1C5E55" ForeColor="#FFFFFF" Font-Bold="True" /><br />
                    <RowStyle BackColor="#E3EAEB" /><br />
            <Columns><br />
                <asp:BoundField DataField="REF" HeaderText="REF" SortExpression="REF" <br />
                    ItemStyle-Width="60px" ><br />
<ItemStyle Width="60px"></ItemStyle><br />
                </asp:BoundField><br />
                <asp:TemplateField HeaderText="product_id" Visible="False"><br />
                <ItemTemplate><br />
                <asp:Label ID="lblProduct_Id" runat="server" Text='<%# Eval("REF") %>'></asp:Label><br />
                </ItemTemplate><br />
                </asp:TemplateField><br />
                <br />
                <asp:BoundField DataField="Description" HeaderText="Description" <br />
                    SortExpression="Description" ItemStyle-Width="300px" ><br />
<ItemStyle Width="300px"></ItemStyle><br />
                </asp:BoundField><br />
                <asp:TemplateField HeaderText="Description" Visible="False"><br />
                <ItemTemplate><br />
                <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description")%>' ></asp:Label><br />
                </ItemTemplate><br />
                </asp:TemplateField><br />
                <br />
                <asp:TemplateField HeaderText="QTY"><br />
                <ItemTemplate><br />
                <asp:TextBox ID="TxtQTY" runat="server" Width="30px" Text='<%# Eval("QTY") %>' /><br />
                </ItemTemplate><br />
                </asp:TemplateField><br />
                <br />
                <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" <br />
                    ItemStyle-Width="80px" ><br />
<ItemStyle Width="80px"></ItemStyle><br />
                </asp:BoundField><br />
                <asp:TemplateField HeaderText="Price" Visible="False"><br />
                <ItemTemplate><br />
                <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price")%>' ></asp:Label><br />
                </ItemTemplate><br />
                </asp:TemplateField><br />
                <br />
                <asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" <br />
                    ItemStyle-Width="80px" ><br />
<ItemStyle Width="80px"></ItemStyle><br />
                </asp:BoundField><br />
                <asp:TemplateField HeaderText="Cost" Visible="False"><br />
                <ItemTemplate><br />
                <asp:Label ID="lblCost" runat="server" Text='<%# Eval("Cost")%>' ></asp:Label><br />
                </ItemTemplate><br />
                     <FooterTemplate><br />
                        <asp:Label ID="lblSubTotal" runat="server" ForeColor="#ffffff" /><br />
                    </FooterTemplate><br />
                </asp:TemplateField><br />
                <br />
                <asp:TemplateField HeaderText="Select"><br />
                <ItemTemplate><br />
                <asp:CheckBox ID="chkSelection" runat="server" /><br />
                </ItemTemplate><br />
                </asp:TemplateField><br />
            </Columns><br />
                    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /><br />
                    <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /><br />
                    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /><br />
                    <EditRowStyle BackColor="#7C6F57" /><br />
                    <AlternatingRowStyle BackColor="White" /><br />
        </asp:GridView><br />


protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        Label lblCost = (Label)e.Row.FindControl("lblCost");
        float price = float.Parse(lblCost.Text);
        tprice += price;
    }

    if (e.Row.RowType == DataControlRowType.Footer)
    {
        Label lblSubTotal = (Label)e.Row.FindControl("lblSubTotal");
        lblSubTotal.Text = tprice.ToString();
    }
}


Please assist where I am doing wrong...

cheers,
sneha

AnswerRe: total and subtotal in gridview footer Pin
Nishant Singh8-Nov-09 23:38
Nishant Singh8-Nov-09 23:38 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 0:21
professionalRajpootRohan9-Nov-09 0:21 
GeneralRe: total and subtotal in gridview footer Pin
Member 42191699-Nov-09 0:24
Member 42191699-Nov-09 0:24 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 0:29
professionalRajpootRohan9-Nov-09 0:29 
GeneralRe: total and subtotal in gridview footer Pin
Member 42191699-Nov-09 0:36
Member 42191699-Nov-09 0:36 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 0:40
professionalRajpootRohan9-Nov-09 0:40 
AnswerRe: total and subtotal in gridview footer Pin
Nishant Singh9-Nov-09 0:51
Nishant Singh9-Nov-09 0:51 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 0:57
professionalRajpootRohan9-Nov-09 0:57 
AnswerRe: total and subtotal in gridview footer Pin
Nishant Singh9-Nov-09 0:55
Nishant Singh9-Nov-09 0:55 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 0:59
professionalRajpootRohan9-Nov-09 0:59 
GeneralRe: total and subtotal in gridview footer Pin
Nishant Singh9-Nov-09 1:13
Nishant Singh9-Nov-09 1:13 
GeneralRe: total and subtotal in gridview footer Pin
RajpootRohan9-Nov-09 1:19
professionalRajpootRohan9-Nov-09 1:19 
QuestionUnable to host WCF service in IIS7 Pin
cranialsurge8-Nov-09 22:22
cranialsurge8-Nov-09 22:22 
AnswerRe: Unable to host WCF service in IIS7 Pin
Gamzun8-Nov-09 23:43
Gamzun8-Nov-09 23:43 
Questionfileupload postback Pin
m@dhu8-Nov-09 21:35
m@dhu8-Nov-09 21:35 
AnswerRe: fileupload postback Pin
Gamzun8-Nov-09 21:39
Gamzun8-Nov-09 21:39 
GeneralRe: fileupload postback Pin
m@dhu8-Nov-09 21:49
m@dhu8-Nov-09 21:49 

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.