Save calculated value in gridview

S

staeri

I have a gridview which calculates a value in a templatecolumn. I want
to save the calculated value into the database when all the other data
is saved. How can I do that?

As it is now I don't have any code-behind, I'm only using the built-in
ASP.NET 2.0 functions.

The templatecolumn looks like this:

<asp:TemplateField HeaderText="Belopp (kr)"
FooterStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="right"
ItemStyle-HorizontalAlign="right" FooterStyle-HorizontalAlign="Right">

<ItemTemplate>
<%#GetAmount(Decimal.Parse(Eval("UnitPrice").ToString())).ToString("N2")%>

</ItemTemplate>

</asp:TemplateField>

// SE
 
O

OHM

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound

If e.Item.ItemType = ListItemType.Footer Then

dim sumTotal as double = Ctype(e.Item.Cells(1).Text ,double)

'OK, Now do something with the value

End If



End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top