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; 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -