Simple question about WinForms and ListView

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-06-14T04:12:54Z Indexed on 2010/06/14 4:22 UTC
Read the original article Hit count: 379

Filed under:
|

Hello

I have a ListView in my WinForms application. ListWiew has 4 columns. So i want to write string in fourth column on every LisViewItem. When i try it.

foreach (ListViewItem item in lvData.Items)
                {
                    item.SubItems[3].Text ="something";
                }

i get an exception

InvalidArgument=Value of '4' is not valid for 'index'.
Parameter name: index

What's wrong?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms