C# WPF Binding a text file to datagrid -


how can bind text file datagrid c# wpf? idea have row in text file show row in datagrid.

i don't think can bind text directly datagrid

what can bind objet datagrid

create objet representing text file.

-- content --   text1, param1, param2   text2, param1, param2    class oneline{   string text {get;set;}     string param { get;set; }   ... } 

you can bind objects datagrid bindinglist, list. magic lies in properties of object. bindinglist try each property of object , display them in grid.

bindinglist<oneline> mylist = new bindinglist<oneline>(); mylist.add(oneobject);  datagrid mygrid = new datagrid(); mygrid.datasource = mylist; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -