I need to test whether or not a RadWindow is in the Windows collection of a RadWindowManager.
"Easy" I thought, I'll add an extension method ...
However, when called it always throws an exception in the test if(window.ID.ToLower() == id) and reports the window.ID is null.
If I drill down through the object's structure all the way to WebControl I can see that, in fact, ID is set but it isn't my value (the one assigned in the markup), but, rather is an automagically assigned value like cl001.
OK, so you are managing the ID, but I can't find a property anywhere that has the value that I assigned and that I can test against.
What am I missing?
--
Stuart
"Easy" I thought, I'll add an extension method ...
public static RadWindow FindWindowByID(this RadWindowManager WindowManager, string ID){ if (String.IsNullOrWhiteSpace(ID)) { throw new InvalidOperationException("Searching for a blank ID is not supported)"); } string id = ID.ToLower(); if (WindowManager.Windows.Count == 0) { return null; } RadWindow result = null; foreach (RadWindow window in WindowManager.Windows) { if (window.ID.ToLower() == id) { result = window; break; } } return result;}However, when called it always throws an exception in the test if(window.ID.ToLower() == id) and reports the window.ID is null.
If I drill down through the object's structure all the way to WebControl I can see that, in fact, ID is set but it isn't my value (the one assigned in the markup), but, rather is an automagically assigned value like cl001.
OK, so you are managing the ID, but I can't find a property anywhere that has the value that I assigned and that I can test against.
What am I missing?
--
Stuart