MaterialSkin icon indicating copy to clipboard operation
MaterialSkin copied to clipboard

MaterialCheckedListBox not clearing displayed items

Open TomsDev67 opened this issue 5 years ago • 6 comments

Hello,

I've added a MaterialCheckedListBox in my UI. After that I've added some items in it. And when I want to clear the list to feed it with some other items, nothing happens in the UI. materialCheckedListBoxRights.Items.Clear(); In code, "Items" is really cleaned in my case from 17 objects to 0.

TomsDev67 avatar Feb 19 '20 09:02 TomsDev67

Hi, thanks for reporting. This sounds like an visual glitch, could you please do some tests and report back? I'm little short on time to test this myself 😢

clone the project and add the .cs file to your solution and then change the reference, then, while in debug mode, please do the following:

  • If you clear it and then inspect the items property of the listbox, does it still shows the items in the array?
  • Does the buttons still works? can you click them? do events fire?
  • Does calling materialCheckedListBoxRights.Refresh() after clearing fixes it?
  • Does removing a single item works?

leocb avatar Feb 20 '20 11:02 leocb

I'll do some tests a bit later, that's not a problem for me ;-) I'll keep you informed 👍

TomsDev67 avatar Mar 02 '20 08:03 TomsDev67

Hi @TomsDev67, did you figure this one out?

leocb avatar Apr 22 '20 05:04 leocb

Hey @leocb, Sorry for late answer, I had to work on some other things since the last time, I had no really time to check :-S

TomsDev67 avatar May 14 '20 12:05 TomsDev67

I have the same problem. The materialCheckedListBoxRights.Refresh() does not work. Hope you can fix or have work-around solution. Thanks

changuyen78 avatar Oct 11 '20 18:10 changuyen78

Hi, thanks for reporting. This sounds like an visual glitch, could you please do some tests and report back? I'm little short on time to test this myself 😢

clone the project and add the .cs file to your solution and then change the reference, then, while in debug mode, please do the following:

  • If you clear it and then inspect the items property of the listbox, does it still shows the items in the array?

The items property will be cleared correctly

  • Does the buttons still works? can you click them? do events fire?

Yes the events are still fired

  • Does calling materialCheckedListBoxRights.Refresh() after clearing fixes it?

No it has no effect. Calling .Update() didn't fix the problem either.

  • Does removing a single item works?

Yes it actually worked.

So for now, I used the following code as a temporary measure to workaround this issue:

while (clbReportHistory.Items.Count > 0)
    clbReportHistory.Items.Remove(clbReportHistory.Items[0]);

@leocb if don't have enough time, I can help by submitting a PR if you just direct me to the portion of the code that you are suspicious about.

information-security avatar Jun 27 '21 21:06 information-security