In a standard .NET ListView control, there is a property in the ListViewItem object called Bounds. This allows the developer to find out what the bounds are of any particular item. I use it to find the bounds of the last item in the list. I then resize the control dynamically so that all items will be visible with no scrollbars. The control has limited items, so this is fine. How can I accomplish the same functionality with the UltraListView control?
UltraListViewItem does not expose a Bounds property. It exposes a UIElement property, which in turn exposes a Rect property, which represents the bounds of the item, but is only available when the item is within the viewable area of the control, and is expressed as relative to the viewable area of the control. If you like you can submit a feature request for a Bounds property that returns the absolute position of the item.
Ok, I will submit a feature request, but I imagine it will be a long time if it is handled. It's unfortunate that this was not put in to the UltraListView since it is a feature of the standard ListView.
So, I guess I could find the size of the first visible item using the UIElement Rect property and then calculate what the last item would be based on how many items are in the control and then size it that way. Does that sould like a workable solution?
However, the problem that I have seen is that the UIElement property comes back as null as in this code. Why would this be??