VB.NET - GridView Grouping,Subtotal & Grandtotal rows

Asked By Alican on 30-Jun-11 04:54 AM
gridview,VB,Grouping,Subtotal,GrandTotal
I am looking for Vb code of gridview table with subtotals and grand total and Grouping at the same time

http://www.agrinei.com/gridviewhelper/sample/gridviewhelpersample_en.aspxhttp://http://www.agrinei.com/gridviewhelper/sample/gridviewhelpersample_en.aspx
*choose

but i would like to change column names like Orderdate,Productname,ProductId(group by),GroupId,Warehouse,Quantity

Thanks all.
Ravi S replied to Alican on 30-Jun-11 05:20 AM
HI

for subtotal

Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs)


	If e.Row.RowType = DataControlRowType.DataRow Then


		Dim gv As GridView = TryCast(e.Row.FindControl("gvReports"), GridView)



		Dim footerRow As GridViewRow = gv.FooterRow



		For Each row As GridViewRow In gv.Rows


			Dim labelTotal As Label = TryCast(footerRow.FindControl("lblTotal"), Label)



			dayHour += [Double].Parse(TryCast(row.FindControl("lblHour"), Label).Text)


			labelTotal.Text = dayHour.ToString()
		Next



		totalHour += dayHour




		dayHour = 0.0
	End If

End Sub

refer the link for details
http://forum.aceboard.net/164661-2513-13302-0-Nested-GridView-Grouping-Displaying-SubTotals-GrandTotals.htm
http://www.dotnettwitter.com/2011/02/group-total-grand-total-in-grid-view.html

for conversion refer this link
http://www.developerfusion.com/tools/convert/csharp-to-vb/
Alican replied to Ravi S on 30-Jun-11 06:04 AM
thank you ravi for link i will try them but i tried that converter before it wasnt good at all .
Mihir Soni replied to Alican on 30-Jun-11 07:52 AM
Hello,

You can use following gridview it's fully functionally and you can do many operations on gridview data

http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm

HTH

thank you
Alican replied to Mihir Soni on 30-Jun-11 08:28 AM
thank you Mihir i tried that codes yesterday its working in C# but when i translate to VB it doesnt work :/