MaterialSkin
MaterialSkin copied to clipboard
MaterialCheckedListBox not clearing displayed items
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.
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?
I'll do some tests a bit later, that's not a problem for me ;-) I'll keep you informed 👍
Hi @TomsDev67, did you figure this one out?
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
I have the same problem. The materialCheckedListBoxRights.Refresh() does not work. Hope you can fix or have work-around solution. Thanks
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.