c# - Create instances of classes that populate forms in Visual Studio -
i want instantiate classes have written in visual studio 2008 , populate listview these instances resides in form opens within visual studio. give example let's have class employee
within our solution. using vs extensibility open form in vs contains listview. create 100 employee
instances populating listview , able edit properties. if change in class employee
e.g: add attribute date of birth, listview have updated. can provide examples or links helpful?
assuming uderstanding question correctly, have form listview, , when open form on opening create 100 instances of employee first step.
start array list of employee.
list<employee> employeelist = new list<employee>();
populate list when form loads.
private void form1_load(object sender, system.eventargs e) { for(int = 0; < 100; i++) { employeelist.items.add(new employee()); } // bind employeelist listview listview.itemsource = employeelist; }
if update employeelist , refresh listview should update changed information.
Comments
Post a Comment