How to load <list> data into dataGridView in c# -
i have rows , columns datagridview
in c# widows form application. how can display data `datagridview..whole data in list. now, want load list datagridview.. new c# , appreciate help.
in question didn't mention type of list use. try using data table.
datatable dt = new datatable(); dt.columns.add("firstname"); dt.columns.add("lastname"); foreach(var oitem in yourlist) { dt.rows.add(new object[] { oitem.firstname, oitem.lastname }); } mydatagridview.datasource = dt;