Sunday, 15 April 2012

c# - Is DataGridView wrong choice? -



c# - Is DataGridView wrong choice? -

i new c# , windows forms please patient. making windows form lets load video, load script, makes captions. want display table info populated automatically mark starts , ends of caption , select text , editable. @ end want save info xml file. datagridview ui-wise seems want, can't figure out backend how info out of datagridview ( preferably in dataset).

i considering using listview multiple columns instead. advice appreciated

datagridview should work fine application , can retrieve info save doing:

dgvthing.datasource;

that contain whatever type have saved datagridview (list, array, etc).

example:

public class superfunobject { public timespan start { get; set; } public timespan end { get; set; } public string selectedtext { get; set; } public superfunobject(timespan a, timespan b, string text) { start = a; end = b; selectedtext = text; } } list<superfunobject> funlist = new list<superfunobject>(); funlist.add(new superfunobject(timespan.fromseconds(0.0),timespan.fromseconds(20.0),"hello")); dgvthing.datasource = funlist; ... ... //retrive list list<superfunobject> getdata = ((list<superfunobject>)dgvthing.datasource);

i hope illustration helps bit. side note, reason accessors (get,set) datagridview able retrieve info object display.

c# winforms datagridview dataset

No comments:

Post a Comment