New C1TreeView question

Posted by: kbj on 4 April 2018, 11:11 am EST

    • Post Options:
    • Link

    Posted 4 April 2018, 11:11 am EST - Updated 4 October 2022, 2:52 am EST

    With a fixed width treeview column, is there a setting for a CustomContentPresenter for a text item that would re-wordwrap the text if:

    1. the user resizes the column
    2. the item is a child of the the node

      If I set both AutoWidth and AutoHeight properties for the TextElement and the RowPanel it sits in, the parent node renders correctly but the child cuts off part of the text.

    Thanks

  • Posted 4 April 2018, 12:36 pm EST

    Oh and to add another question, is there a way to test if the C1TreeView vertical and/or horizontal scrollbars are visible?

  • Posted 5 April 2018, 6:31 am EST

    Hi Kingman!

    This is being discussed with the team, and I will come back to you soon.

    Thanks,

    Meenakshi

  • Posted 9 April 2018, 10:23 am EST

    Hi Kingman!

    Oh and to add another question, is there a way to test if the C1TreeView vertical and/or horizontal scrollbars are visible?

    I found workaround for this case:

    
    if (c1TreeView1.IsHandleCreated)
                {
                    int wndStyle = GetWindowLong(c1TreeView1.Handle, GWL_STYLE);
    
                    bool vsVisible = (wndStyle & WS_VSCROLL) != 0;
                    System.Diagnostics.Debug.WriteLine("VSCROLL " + vsVisible);
    
                    bool hsVisible = (wndStyle & WS_HSCROLL) != 0;
                    System.Diagnostics.Debug.WriteLine("HSCROLL " + hsVisible);
                }
    
     internal const int
                WS_VSCROLL = 0x00200000,
                WS_HSCROLL = 0x00100000,
                GWL_STYLE = -16;
    
            [DllImport("user32.dll")]
            static private extern int GetWindowLong(IntPtr hWnd, int nIndex);
    
    
  • Posted 9 April 2018, 10:34 am EST

    Kingman,

    about first question, try set Style.WorWrap property of TextElement as true.

    var e = new TextElement();
    e.Style = new Style();
    e.Style.WordWrap = true;
    
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels