| Author: Dilip Kumbhar 19 Sep 2006 | Member Level: Gold | Rating: Points: 2 |
Data can not be displayed in footer. But try to remove footer.Add a table and match its column with grid.Write public functions for binding grid.Take a hidden text box or take their sum and display in table added at footer
|
| Author: shruthi 19 Sep 2006 | Member Level: Gold | Rating: Points: 2 |
Thank you Dilip
Let me try doing it.....
|
| Author: SAMIR SRIVASTAVA 19 Sep 2006 | Member Level: Gold | Rating: Points: 2 |
You can display the some in the data grid. Do the following steps 1. Check the footer check box when you right click on the datagrid. 2. Do the double click on datagrid in the view designer and select the itemdatabound event and write the following code in itemdatabound.
Private Sub DataGrid1_ItemDataBound1(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem) Then For i = 1 To DataGrid1.Items.Count + 1 e.Item.Cells(0).Text = i(this show serial no but add template coumn at 0 column) Next i = i + 1 uptotal1(Double.Parse(e.Item.Cells(2).Text.ToString))
ElseIf (e.Item.ItemType = ListItemType.Footer) Then
e.Item.Cells(1).Text = "Total" e.Item.Cells(2).Text = UnitpriceR1.ToString() End If End Sub
3. Call the following function Protected Sub uptotal1(ByVal contactno1 As Double) Unitprice1 += contactno1 UnitpriceR1 = (Unitprice1) End Sub//this will calculate the add of the column 2
|
| Author: shruthi 19 Sep 2006 | Member Level: Gold | Rating: Points: 2 |
thanks
|
| Author: shruthi 19 Sep 2006 | Member Level: Gold | Rating: Points: 2 |
Hi Samir, Just a doubt
what is Unitprice1 UnitpriceR1
|