Recommendations for C# controls that can be used to create a hierarchical list of prioritised items?
I need to be able to display and edit a hierarchical lis开发者_运维问答t of tasks in a C# app. It can either be a Windows form app, or ASP.NET.
Basically, I want similar behaviour to the way Microsoft Project handles tasks.
The control would need to:
1) Maintain a list of items made up of several fields
2) Each item can have a number of children (at least 3 levels of nesting)
3) It needs to be very easy to change the parents/children of an item
4) It needs to be very easy to edit the fields (as fast as changing cells in Excel)
5) It needs to be very easy to reorder the items by dragging and dropping or cut and paste
6) If I can easily connect the control to a database, even better
Anyone got any recommendations for controls for me to look at?
Hierarchical data structures (trees) are visualized with treeview controls. There are built-in treeviews in ASP.NET and WinForms but given that you are looking for features such as editing and drag & drop, you might consider a commercial product. Commercial products will make the job of adding these features easier than using built-in controls.
A favourite of mine are the Telerik controls. They sell WinForms, ASP.NET (and Silverlight) versions of treeviews.
Telerik grids (RadGrid) also supports nesting of rows. If your hierarchical data has a known and limited depth and, especially, a meaning to each level of depth, then using the nested rows of a RadGrid (or similar product from another vendor) would work well too.
精彩评论