Hi,
I'm working with the UltraWinListView Control and Groups. I have the following example-code:
UltraListView view;Console.WriteLine("Chk: " + view.Groups.Contains("x")); // Chk: False Console.WriteLine("Add: " + view.Groups.Add("x").Key); // Add: x Console.WriteLine("Chk: " + view.Groups.Contains("x")); // Chk: False
I would expect the Contains-method the return true in the second call, since a Group keyed "x" is already in there.
How can I check, if a by key specified group exists?
When does Contains() actually return true?
Thank you
Patrik
Hello Patrik,
Thank you for posting in our forum.
When you call Contains method of the groups collection you need to pass as parameter an object and not a key as a string. If you need to check for a specific key you may use Exist method of the groups collection.
Please check the attached sample project implementing this approach.
Please let me know if you need any further assistance.
Sorry, I should have mentioned that I'm force to use Version 2013.1. Is there a similar solution available?
Other than try { Groups["x"] } catch { Add("x") }
My thought was: When there is an Add(string key)-Method, the Contains()-Method would work accordingly.
Hello Petrik,
I am just checking about the progress of this issue. Let me know if you need our further assistance on it.
Thank you for using Infragistics Components.