Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
565
Column Headers Not Showing With Empty DataTable
posted

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.

Parents
No Data
Reply
  • 23930
    Offline posted

    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.

    WT_BindToEmptyDataTable.zip
Children