7

Currently am working on an winforms application which shows contacts, but I have a problem with memory.

For each contact I build a panel with labels inside for name inside for name and number, and I will add this to my main Panel. Assume I have 1000 contacts; I would end up creating 1000 Panels along with one main panel.

My problem is, even though only 10 or so Panels (contacts) are visible in main Panel at any one time, I would still build all 1000 Panels, which is consuming a lot of memory.

I want a way to only build the Panel which are visible in main Panel. Ideally I want something similar to the RecyclerView in android. Is there any library which does similar to this in C# or Winforms?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
anil kumar d
  • 157
  • 2
  • 10

2 Answers2

0

You can use grids.

For example, devexpress grids can be customized in many ways and look like your Listview (display rows as cards etc.)

https://www.devexpress.com/Products/NET/Controls/WinForms/Grid/

Mikhail Lobanov
  • 2,976
  • 9
  • 24
0

Winforms does not currently support recycle-view kind of list views. For this sme third-party vendors are offering related solutions with there controls. Try ObjectListView which is open-source. Its sourced at code-project

Job M
  • 3,331
  • 2
  • 19
  • 26
  • Also check out [this] (https://www.codeproject.com/Articles/333864/Flexible-List-Control) – Job M Oct 13 '17 at 22:13