Hello,
When binding a datatable to a wintree everything is displayed as it should, in a grid style fashion.
The problem is when the datatable doesn't contain any rows (it does contain datacolumns), so the wintree column headers aren't displayed.
I checked to see the Columns in the ColumnSet and they are populated as they should be but still the wintree will not display the column headers.
How can I display the Column Headers when the data table doesn't contain any rows ?
Thanks.
Hi Kal,
Thank you for contacting Infragistics Developer Support.
The ultraTree will display the columns only if there are nodes in the tree. One way to display the columns is to add a dummy node to the tree and then to not draw it using the DrawFilter interface. All you have to do in the DrawFilter is to check if the element is of type TreeNodeUIElement in the GetPhasesToFilter method of the element. If it is return its BeforeDrawElement phase and then in the DrawElement method return true. For more information on the DrawFilter interface please visit this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/Win_Draw_Filter.html
I have attached a sample demonstrating this suggestion.
Please let me know if you have any additional questions.
Thank you for quickly replying.
Can I do this only for a specific node ?
Hello Kal,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Thank you for the reply.
If you are not willing to use the dummy row approach, you can log a new product idea, for a property that will allow you to show the columns even if the tree is empty. You can log the idea in our product ideas site: <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible.
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.
is there a solution without adding a dummy row ?
Do you mean for a node with a specific key? You can do that in the DrawFilter DrawElement method by using the following code inside it:
var node = drawParams.Element.GetContext() as UltraTreeNode;
return node.Key == "MyTreeNode";
If that isn’t the case please clarify your requirement.
I am looking forward to your reply.