[RESOLVED] vb.net 2012 - Datagridview - Add summary rows
Heres my issue... my wifes website lets you order flowers. After the order is submitted, it will show on a special page for her. I am creating a PointOfSale system that will pull this data right into the app and display there instead of needing to keep a webpage open. My problem is trying to re-create the display of this.
Its a simple table online
http://i.imgur.com/c0DFBR1.png
you click the button in the first column and it shows you the order (for printing)
Now, I have the DataGridView loading the data, and if you click a row it gets the order number.. fine.. i have even made it look similar.
Question 1 (not important): Can I add a button in the first column? like shown or will it take over the first column (so its filled) - and can i add a clickable image (the map)
Question 2 (more important): How can i add the summary rows!?
This is really needed... at each change in the date, a summary total needs to be shown. Can i do this?
Should I do this unbound so i can control each row? or.. should i use a listview?
Thanks!
Re: vb.net 2012 - Datagridview - Add summary rows
Erm ... if the web version works why don't you just replicate it at local level and show it in a webbrowser control? Any additional processing you may need can be done behind the scenes.
Re: vb.net 2012 - Datagridview - Add summary rows
i dont want to convert her machine to run it locally (PHP etc)...
(and thats cheating!! lol)
I really wanted to have it fully contained in the app.... and I have found the solution!!
it seems i can add rows to the dataset/table after!!
Code:
Dim DT As Date = FormatDateTime(DGV1.Rows(0).Cells(1).Value, DateFormat.ShortDate)
Dim SUM As Decimal = 0
Dim RC As Integer = DGV1.Rows.Count - 1
Dim DR As DataRow
Dim X As Integer
Do While X <= RC
If DT = FormatDateTime(DGV1.Rows(X).Cells(1).Value, DateFormat.ShortDate) Then
SUM = SUM + DGV1.Rows(X).Cells(10).Value
Else
DR = DS.Tables(0).NewRow
DR.Item(10) = SUM
DS.Tables(0).Rows.InsertAt(DR, X)
X = X + 1
RC = RC + 1
SUM = DGV1.Rows(X).Cells(10).Value
DT = FormatDateTime(DGV1.Rows(X).Cells(1).Value, DateFormat.ShortDate)
End If
X = X + 1
Loop
DR = DS.Tables(0).NewRow
DR.Item(10) = SUM
DS.Tables(0).Rows.InsertAt(DR, RC + 1)
DGV1.Refresh()