❔ How to add rows in ListView using For loop?
So I'm trying to add multiple rows in ListView using loops.
I write up this
And I only get 1 row filled seem in the screenshot I took. When I put in
string [i] row =
, I get the error CS0270 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
.5 Replies
you have to use Items.AddRange to add more than one item a single call
like
But how would I add the range based on the number of items in the list (for AList)?
i don't understand the question
It's WinForms or WPF?
WPF > ObservableCollection<Model> and it would be added automatically...
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.