B4J Code Snippet Set the resize policy of tableview columns.

Discussion in 'B4J Code Snippets' started by rwblinn, Jun 8, 2016.

  1. rwblinn

    rwblinn Well-Known Member Licensed User

    Two options to set the resize policy of TableView columns.

    CONSTRAINED
    Adjusts the width of the columns if one column changes; starting from the column right to the one changed. Reference here.
    Code:
    Sub TableView1_SetColumnResizePolicy_CONSTRAINT
      
    Dim joTV As JavaObject = TableView1
      joTV.RunMethod(
    "setColumnResizePolicy"Array(joTV.GetField("CONSTRAINED_RESIZE_POLICY")))
    End Sub
    UNCONSTRAINED
    Shifts all other columns (right of the given column) further to the right (when the delta is positive) or to the left (when the delta is negative). Reference here.
    Code:
    Sub TableView1_SetColumnResizePolicy_UNCONSTRAINED
      
    Dim joTV As JavaObject = TableView1
      joTV.RunMethod(
    "setColumnResizePolicy"Array(joTV.GetField("UNCONSTRAINED_RESIZE_POLICY")))
    End Sub
     
    fredo, walt61, AlbertDE and 3 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice