0

I have looked everywhere and I can't seem to find how to make a simple table in C# winforms. Some say a Data set, a Data grid view, or a flow document. I want to just simply transfer values (scores, in my case.) to an XML doc and display the values on a table in a form. I already found out how to transfer values to a.txt file using the Stream Reader class. Is there a similar way I could do the same with data and a table? Do I have to make a SQL Server? I didn't know this would be so difficult to find an answer to... Thank you, this really helps.

Noah
  • 103
  • 5

1 Answers1

0

Have you tried ListView? You can parse your txt file using StreamReader, and keep the scores in list i.e.: List<score> scores. Then update your ListView, in a foreach cycle, for example:

scoresListView.Clear(); foreach(var item in scores) { scoresListView.Add(item); }

Unfortunately, ListView in WinForm does not allow design-time data binding. There's a good article about this: http://www.codeproject.com/Articles/10008/Data-binding-a-ListView

Alex
  • 3,689
  • 1
  • 21
  • 32