WPF GridViewColumn Binding

WPF GridViewColumn Binding

Greetings,

I need help binding a List of StudentData into WPF GridViewColumns. See code at http://www.4shared.com/file/ZejJF2-J/ComprehensiveProgram.html.

I created a tabbed WPF form where the first page is data entry. Each time the button is clicked a new StudentData object is added to MyList. This works fine except I can't figure out how to bind the data to the GridViewColumns on the second tab. Line 32 (ReportListView.ItemsSource = MyList();) gets error "The name 'MyList' does not exist in the current context"

I tried creating a GotFocus event for the Report tab (line 70), but the same error is issued.

I have searched the web and can find nothing that applies to my particular situation. I hope someone can help me resolve this issue.

Thanks, in advance.

I learned from http://www.switchonthecode.com/tutorials/wpf-tutorial-using-the-listview-part-1 that maybe I should have used ObservableCollection rather than List since I am updating the list. Here is the new version of the program http://www.4shared.com/file/q6UmfdzT/ComprehensiveProgram_new_versi.html.

The problem with the new program is that when I add items the data from the last item replaces all the data from all the items already in the "list". Also, nothing displays on the ListView.

Please help.

perstam
05/03/2010 - 11:12

Fixed my problem.

Here's the solution http://www.4shared.com/file/y9sgc7MS/ComprehensiveProgram_fixed_ver.html

reply

Add Comment

Put code snippets inside language tags:
[language] [/language]

Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]

See here for supported languages.

Javascript must be enabled to submit anonymous comments - or you can login.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.