如何在c#中的listview中显示数组值
问题描述:
嗨早安
任何人都可以帮助我
如何在winform C#中绑定一列listview。我有一个int数组我想在列中显示数组值。
和其他列中的序列号
喜欢
S.no 。价值
1 25
2 30
3 60
值列想要将数组和s.no绑定到我有的计数变量。
Hi Good Morning
Could anyone help me
How to bind a column of listview in winform C#. i have an array of int i want to display array values in a column.
And serial number in other column
like
S.no. Values
1 25
2 30
3 60
values column want to bind with array and s.no to a count variable i have.
答
private void btn_CreateReport_Click(object sender, EventArgs e)
{
lstview.Items.Clear();
int counterOfArraylist = mcarraylist.Count;
string[] str = new string[counterOfArraylist];
for (int i = 0; i < str.Length; i++)
{
str[i] = mcarraylist[i].ToString();
}
lstview.Items.Add(new ListViewItem(str));
}
------