I am looking for a tree control in windows forms to represent heterogeneous data. Below is an example.
http://es.infragistics.com/samples/wpf/tree-grid/heterogeneous-data
What can I use to accomplish this functionality in windows forms.
Hi,
The closest thing on the WinForms side would be the UltraTree control. It has the ability to display columns like a grid in several different styles.
I'm not 100% sure that the WinTree could do heterogeneous data in quite the same way as the screen shot of the TreeGrid, though. The Size column in the screen shot is showing both strings and numeric values at the same level in some cases and I'm not aboslutely sure the WinTree can do that. Of course, if the numbers were stored as strings, it would not be a problem. But if you needed to store data as both strings and numeric data at the same level in the hierarchy for different nodes, I'd have to investigate whether or not that's possible. Actually... I'm pretty sure it's possible in the FreeForm style, but that sytle shows multiple headers and the screen shot here shows only one set of headers, which would be more like OutlookExpress style.
So it's hard to say whether the WinTree will meet your needs without knowing a lot more details about exactly what your requirements are.
The screenshot I posted is the closest I found to my requirements.
To be more specific.
1. I am looking to group the data like the first column shown in the screenshot. (Necessary feature)
2. Need to have a single header with the capability to filter data. (Necessary feature)
3. I won't have heterogeneous data in a single column like "Size" column.
Can I achieve the above with UltraGrid in the OutlookExpress style?
1) I'm not sure what you mean by grouping. Do you mean the hierarchy with the expansion indicators?
WinTree does not have any built in filtering. So if that's an absolutely necessary feature, then that pretty much rules out the WinTree. WinGrid has grouping, but it doesn't really display in quite this style. The expansion indicators in the grid are always outside the row (to the left) instead of inside a cell like they are here. Not sure if that's a dealbreaker for you. If it is, then you could probably work around it using a CreationFilter to put ExpandsionIndicators inside the cell. The row connectors lines would be MUCH trickier, though.
Also, the WinGrid's filtering only filters one level of the data by default. You could write some code to copy the filters to each band, but the grid bands are essentially fixed, so you could need to know how many bands (levels of depth) you are going to have up front. The grid is pretty rigid about it's data structure, unlike the tree.