Since retiring in 1997 I have concentrated upon researching and publishing material and a website at www.bobagans.org , this I call this my vocation. My second pursuit has been in the area of general computing to eventually decide what particular segment of computing I wished to major upon, this I call my hobby.
My present website is my third one that I started on January 5, 2008 at the age of seventy-one. The software that I have used is Microsoft’s 2005, 2008, and now VS 2010 Express ASP.NET 4.
Primary books used:
1. Beginning ASP.NET 4 in C# and VB, by Imar Spaanjaars from the Netherlands, and published by Wrox publishing in 2010. I have found this book to be the one that best explained the basics of computer web design.
2. Professional ASP.NET 4 in C# and VB, by Bill Even, Scott Hansel man, and Devin Rader, also a 2010 Wrox publication. This book, also very informative is quite a bit beyond my ability and probably includes things I will never be interested in.
Concerning my computer hobby, I have narrowed my interests to Microsoft’s VS 2010 Express Visual Basic and .NET 4, which contains and embraces several other platforms. The platforms I am using and wish to learn more thoroughly are Windows Presentation Foundation (WPF), Entity Framework (EF) and Visual Basic (VB); I especially like and enjoy Extensible Application Markup Language (XAML).
Primary books used:
1. Visual Basic 2005 - Programmer’s Reference, by Rod Stephens, a 2005 Wrox publication.
2. Professional Visual Basic 2010 and .NET 4, by several authors and also a Wrox 2010 publication.
3. Pro WPF in VB 2010 in .NET 4, by Matthew MacDonald, a 2010 Apress publication.
These and other books and publications that I have read explained that WPF was a new way of doing Windows Applications, the former way was by using Windows Forms, which I had used until 2010. While WPF has a much greater potential, it is also much harder to learn. Also, because it is so new, there is a shortage of information on how to do some of what I have in the past done with Windows Forms. Over the past year I have searched the book stores and the internet without much success, because the specific information I am looking for is how to edit, save and update to the database the WPF datagrid, and then get individual cell data to use in calculations for updating other data tables. The paragraph below will give you an idea of why I am looking for these particular features. I am not a developer or skilled programmer, merely someone who enjoys working with these platforms.
Can you suggest a good and simple source of Visual Basic information on the WPF datagrid to accomplish these goals?
From about 1984 until the plant closed down in Dec. of 1997 I worked in the office as Business and Engineering Administrator for ParaFab Engineering in Lockeford CA., where I developed a Dos Paradox3 business application that handled everything in the office but the making of mechanical drawings. Payroll, purchases and sales, job records and reports and two inventories were all part of this application. I retired in 1998 and soon after began updating the ParaFab business app. to Paradox5 for Windows, just for my own personal enjoyment. In 2004 I became aware of and began to use VB 2005 Express to continue my interest in updating some of this same business application’s functions; since then I have used each new Express edition, both for the web and for the business app. Now I am trying to update some of my business applications functions to WPF.
Latest update:
I think I have found the book I need to answer the questions I previously posted here: Julia Lerman’s book,
Programming Entity Framework – the 2010 second edition. I have come to the conclusion that I need to learn EF more thoroughly before I can proceed with WPF datagrid.
3/19/2011
I was misinformed about Julie’s book,
Programming Entity Framework; the code in it is mostly written in C# with very little in Visual Basic. But it does illustrate the complexity of Entity Framework, and leaves me with little hope that I will be able to find the information I need to edit, find and use individual cell information and then update the database using WPF datagrid in Visual Basic.
5/14/2011
I have switched from Entity Framework to LINQ to SQL to work with my WPF DataGrids and applications, as a result I have been able to go forward with the app's I am working on. Instead of trying to get individual cell contents through VB code, I'm using queries and arrays or queues to get and arrange the contents; this is working well for me, so I will probably not need the information I first requested.
Here is a typical example of the VB code behind to build a customer invoice:
Private Sub btnWriteInvoice_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnWriteInvoice.Click
Dim TextBlock48 = New TextBlock()
TextBlock48.VerticalAlignment = Windows.VerticalAlignment.Top
TextBlock48.HorizontalAlignment = Windows.HorizontalAlignment.Center
TextBlock48.Text = "NorthWind Food Specialists"
Dim TextBlock49 = New TextBlock()
TextBlock49.Margin = New Thickness(0, 0, 0, 15)
TextBlock49.VerticalAlignment = Windows.VerticalAlignment.Top
TextBlock49.HorizontalAlignment = Windows.HorizontalAlignment.Center
TextBlock49.Text = Today
Dim strOID As String = ""
strOID = TextBox1.Text
Dim detailShow = From qi In db.Order_Details
Join pro In db.Products On qi.ProductID Equals pro.ProductID
Where qi.OrderID = strOID
Select qi.OrderID, qi.ProductID, pro.ProductName, qi.Quantity, qi.UnitPrice
Me.DataGrid1.ItemsSource = detailShow
Dim quan = From q In detailShow
Select q.Quantity
Dim lops As Integer = 0
Dim lop2 As Integer = 1
Dim myQ As New Queue()
For Each q In quan
myQ.Enqueue(q)
lops = lops + 1
Next
Dim name = From n In detailShow
Select n.ProductName
lops = 0
lop2 = 1
Dim myQ2 As New Queue()
For Each n In name
myQ2.Enqueue(n)
lops = lops + 1
Next
Dim cost = From c In detailShow
Select c.UnitPrice
lops = 0
lop2 = 1
Dim myQ3 As New Queue()
For Each c In cost
myQ3.Enqueue(c)
lops = lops + 1
Next
Dim strNam As String = "Hello"
Dim intQuan As Integer = 1
Dim sngCost As Single = 1.1
Dim TotalCost As Single = 1.1
Dim TotalCost2 As Single = 0
Dim txtBlock As String = "Put together"
Dim TextBox11 = New TextBox()
TextBox11.Width = 0
TextBox11.Height = 0
Dim cusName As String = TextBox2.Text
Dim TextBox10 = New TextBox()
TextBox10.Width = 0
TextBox10.Height = 0
Dim TextBlock50 = New TextBlock()
TextBlock50.Margin = New Thickness(0, 0, 40, 0)
TextBlock50.VerticalAlignment = Windows.VerticalAlignment.Top
TextBlock50.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock51 = New TextBlock()
TextBlock51.Margin = New Thickness(0, 0, 40, 0)
TextBlock51.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock52 = New TextBlock()
TextBlock52.Margin = New Thickness(0, 0, 40, 0)
TextBlock52.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock53 = New TextBlock()
TextBlock53.Margin = New Thickness(0, 0, 40, 0)
TextBlock53.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock54 = New TextBlock()
TextBlock54.Margin = New Thickness(0, 0, 40, 0)
TextBlock54.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock55 = New TextBlock()
TextBlock55.Margin = New Thickness(0, 0, 40, 0)
TextBlock55.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock56 = New TextBlock()
TextBlock56.Margin = New Thickness(0, 0, 40, 0)
TextBlock56.HorizontalAlignment = Windows.HorizontalAlignment.Right
Dim TextBlock57 = New TextBlock()
TextBlock57.Margin = New Thickness(0, 0, 40, 0)
TextBlock57.HorizontalAlignment = Windows.HorizontalAlignment.Right
For i = 1 To lops
intQuan = myQ.Dequeue
strNam = myQ2.Dequeue
sngCost = myQ3.Dequeue
TotalCost = intQuan * sngCost
TextBox11.Text = TotalCost
TextBox11.Text = Format(TotalCost, "$###0.00")
TotalCost2 += TotalCost
txtBlock = strNam & " <> " & intQuan & " ea @ " & sngCost & "= " & TextBox11.Text
Select Case i
Case 1
TextBlock50.Text = txtBlock
Case 2
TextBlock51.Text = txtBlock
Case 3
TextBlock52.Text = txtBlock
Case 4
TextBlock53.Text = txtBlock
Case 5
TextBlock54.Text = txtBlock
Case 6
TextBlock55.Text = txtBlock
Case 7
TextBlock56.Text = txtBlock
End Select
Next
TextBox10.Text = Format(TotalCost2, "$###0.00")
txtBlock50 = "Total cost of all items for our customer, " & cusName & "= " & TextBox10.Text
If lops = 1 Then
TextBlock51.Text = txtBlock50
End If
If lops = 2 Then
TextBlock52.Text = txtBlock50
End If
If lops = 3 Then
TextBlock53.Text = txtBlock50
End If
If lops = 4 Then
TextBlock54.Text = txtBlock50
End If
If lops = 5 Then
TextBlock55.Text = txtBlock50
End If
If lops = 6 Then
TextBlock56.Text = txtBlock50
End If
If lops > 7 Then
TextBlock57.Text = txtBlock50
End If
Dim container As IAddChild = spInvoice
container.AddChild(TextBlock48)
container.AddChild(TextBlock49)
container.AddChild(TextBlock50)
container.AddChild(TextBlock51)
container.AddChild(TextBlock52)
container.AddChild(TextBlock53)
container.AddChild(TextBlock54)
container.AddChild(TextBlock55)
container.AddChild(TextBlock56)
container.AddChild(TextBlock57)
End Sub
Bob