Is there a way to set a maximum limit on the entries in a listbox control?

  • Thread starter Thread starter Tom Davison
  • Start date Start date
T

Tom Davison

I have an app that imports data from XML files into a listview
control.

I want to limit the number of files, or entries within a file, to a
certain level.

For example have a maximum limit of say 200 rows/entries, which could
allow one XML file of 190 entries or 10 XML files with 20 entries.

Is there a way to place a limit on a listview control so that a
maximum can be placed on the number of entries allowed?

Thanks.

Tom
 
hi,

AFAIK there is no such a thing, you can do two things:

1- Check listview.Items.Count and make sure it's within limits
2- create your own control derived from listview , I'm not sure how you will
handle it this way, as you need to have access to the internal list, create
your own instance of collection where you can control the qty of elements.


cheers,
 
hi,

AFAIK there is no such a thing, you can do two things:

1- Check listview.Items.Count and make sure it's within limits
2- create your own control derived from listview , I'm not sure how you will
handle it this way, as you need to have access to the internal list, create
your own instance of collection where you can control the qty of elements.


cheers,

Thanks a lot, you've helped me find a way to do what I wanted and
saved me a lot of time. I really appreciate it.

Tom
 
Back
Top