Facing this issue after upgrading to Infragistics Ultimate 2022 Vol. 2. Due to this issue I am not able to build my solution.
Hello Dariusz,
I have been investigating into the error message you are seeing, but it is difficult to tell why this is happening without being able to see the entirety of the code you are attempting to use. Would it be possible for you to please provide another screenshot of the code without the large Visual Studio tooltip so I can see the full “Where” statement you are trying to use?
Please let me know if you have any other questions or concerns on this matter.
Hi this is the entire code which I am using. Thanks!
I have been investigating into the code in your screenshot, and it appears that this issue is happening because the UltraToolbarsManager.Tools collection derives from a collection element of ToolsCollectionBase. This class derives from an interface IEnumerable<IToolBaseDesignerInfo>. The interface IToolBaseDesignerInfo is internal and should only actually be used by the control at design time. Since that interface is internal though, this is throwing out issues with the Visual Basic compiler as I believe it sees it as it being possible that the element “t” could be returned as an internal-marked object.
The following code does essentially the same thing that the “From, Where, Select” statement does, but does not throw this error, and as such I would recommend that you use it:
Dim list As List(Of ControlContainerTool) = New List(Of ControlContainerTool)()
For Each tool In UltraToolbarsManager1.Tools If TypeOf tool Is ControlContainerTool Then If DirectCast(tool, ControlContainerTool).Control IsNot Nothing Then list.Add(DirectCast(tool, ControlContainerTool)) End If End If Next
The solution is working without any issues. Thanks!