C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







Data Grid Footer Content...............PLZZZZZZZZZZ REPLY FAST...........


Posted Date: 19 Sep 2006      Total Responses: 5

Posted By: shruthi       Member Level: Gold     Points: 2


Hi, All


1) I have a datagrid, how to display sum of a column(containing price) in Footer
2) Can I Display content of a text box(in the same form) in the footer of datagrid


Thanks in advance

Shruthi




Responses

Author: Dilip Kumbhar    19 Sep 2006Member Level: GoldRating:     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 2006Member Level: GoldRating:     Points: 2
Thank you Dilip

Let me try doing it.....


Author: SAMIR SRIVASTAVA    19 Sep 2006Member Level: GoldRating:     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 2006Member Level: GoldRating:     Points: 2
thanks


Author: shruthi    19 Sep 2006Member Level: GoldRating:     Points: 2
Hi Samir,
Just a doubt

what is
Unitprice1
UnitpriceR1


Post Reply
You must Sign In to post a response.
Next : Urgent.......
Previous : Concurrency.........
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

email fax service

Contact Us    Privacy Policy    Terms Of Use