DataGridView : Getting started
-
Hello, I'm hoping someone can help me out here. I want to get started using DataGridView, but I've not actually managed to find any examples that fit what I'm trying to do. What I want to do is very simple: (1) I have a list of class instances thus:
List classList;
(2) I want eachMyClass
member ofclassList
to be represented as a row in my DataGridView (3) I want to show only a subset of the class parameters, for example:public class MyClass { private string name; private int anumber; // Want to show this in the interface public String Name { get { return (name); } set { name = value; } } // I DON'T want to show this in the interface public int Number { get { return (anumber); } set { anumber= value; } } }
I think that sums it up. No SQL, nothing just a nice list of data that I want to display. Can anyone help? Many thanks!! -
Hello, I'm hoping someone can help me out here. I want to get started using DataGridView, but I've not actually managed to find any examples that fit what I'm trying to do. What I want to do is very simple: (1) I have a list of class instances thus:
List classList;
(2) I want eachMyClass
member ofclassList
to be represented as a row in my DataGridView (3) I want to show only a subset of the class parameters, for example:public class MyClass { private string name; private int anumber; // Want to show this in the interface public String Name { get { return (name); } set { name = value; } } // I DON'T want to show this in the interface public int Number { get { return (anumber); } set { anumber= value; } } }
I think that sums it up. No SQL, nothing just a nice list of data that I want to display. Can anyone help? Many thanks!!My formating didn't come out properly, the first line of code should read: List classList = new List(); classList.Add(new MyClass("Fred")); classList.Add(new MyClass("Wilma")); etc