开发者

populate datagridview from a list and edit the list (adding)

开发者 https://www.devze.com 2023-01-16 16:12 出处:网络
I have a List List <string> aList = new List<string>(); aList.Add(\"A,B\"); aList.Add(\"A,C\");

I have a List

List <string> aList = new List<string>();
aList.Add("A,B");
aList.Add("A,C");
aList.Add("A,D");
aList.Add("A,E");

I have datagridview, and I want to display this list on this datagridview.

aDataGridView.DataSouce = aList; // Dosent seems to work.

When this is displayed on the datagridview I want the user to add to it from the gridview.For example:

DataGridView:

(This column added by the user) and if u开发者_Go百科ser does not add anyhing, that row is excluded from aList.

A B apple

A C banana

A D

A E

Is there anyway I can achieve this. sorry I am a beginner in C#. Many Thanks


I would suggest utilizing a datatable as it can ready be used as a datagridview.datasource.

0

精彩评论

暂无评论...
验证码 换一张
取 消