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 ?
Thank you for the reply.
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.
is there a solution without adding a dummy row ?
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.