Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void dgCustomer_DataBound(object sender, System.EventArgs e)
- {
- Label pLabel = new Label();
- double dItemPremium = (Eval("Premium")!= DBNull.Value) ? (double)(Eval("Premium")) : 0;
- pLabel.Text = dItemPremium.ToString("0.00");
- dTotal_m += dItemPremium;
- dgCustomer.HeaderRow.TableSection = TableRowSection.TableHeader;
- dgCustomer.FooterRow.TableSection = TableRowSection.TableFooter;
- dgCustomer.FooterRow.Controls.Add(pLabel);
- }
- protected void dgCustomer_RowCreated(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- dTotal_m += Convert.ToDouble(DataBinder.Eval(e.Row.DataItem,"Premium"));
- }
- else if (e.Row.RowType == DataControlRowType.Footer)
- {
- e.Row.Cells[0].Text = "Totals:";
- e.Row.Cells[1].Text = dTotal_m.ToString("0.00");
- e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Right;
- e.Row.Font.Bold = true;
- }
- }
- <asp:TemplateField>
- <ItemTemplate>
- <%#DataBinder.Eval(DataItem,"Premium")%></ItemTemplate>
- <HeaderTemplate>
- Premium Amount Paid</HeaderTemplate>
- </asp:TemplateField>
- e.Row.Cells[0].Text
- string tempstr=((Label)dgCustomer.Rows[e.RowIndex].Cells[<cell_number>].FindControl("Label_ID")).Text;
- <ItemTemplate>
- <%= DataBinder.Eval(DataItem,"Premium")%></ItemTemplate>
- <HeaderTemplate>
Add Comment
Please, Sign In to add comment