Results 1 to 3 of 3

Thread: [Answers] TreeGrid

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] TreeGrid

    Each TreeGrid row is a TreeItem which can be referenced by treegrid.currentItem
    Each TreeItem has an icon (property picture) and some text (property text) of its first column. Additional text in treegrid columns can be referenced using treegrid.item(row,col).
    In the "TreeItem" you can reference the text in the columns using treeitem.text(column) which is zero based.
    "RowCount" gives you the number of rows in the TreeGrid.
    "ActiveRow" can be set to the row you want to access, then use CurrentItem to get the object for that row. You should then be able to change its properties.



    Q:
    Code:
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'load' event
    proc page1_section2_load()
            This.tree2.AddItem("library://fltIsEqual.png","Is Equal To")
            This.tree2.AddItem("library://fltIsNotEqual.png","Is Not Equal To")
    endproc
    A:
    Try issuing clear() first.



    Q:
    May I know if it is possible to edit the data in the gridtree itself for a desktop app?
    A:
    You need to relate the selection to another form section or gadget as I did in one of the examples. The TreeGrid itself is not editable.



    A TreeGrid does not handle pagination but insofar as you will not have a huge amount of data displayed in it, it may do what you want. It does not have the flexibility of a Grid section has however.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-02-02 at 04:39.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    I use the treegrid in many parts off my programs , and works fine , but my users need to move the list items up and down , like old listbox in vfp with te property Movebars = .t., Linaja have some like this , or whats the beast way to do this.
    A:
    The TreeGrid does not currently have the option to move the TreeItems up and down in the grid. It does have a SortingEnabled property, that you can set to .T. (true) to allow the users to click on the column header(s) to sort by that column.
    Also the addListItem() and setListItem() methods allow you to
    specify the row/column position - maybe those could be used.
    The other option is to
    clear and then load the items in the corrected order.



    Q:
    I try to use the Setlistitem but I have a Data type mismatch in parameter list.
    here is :
    Code:
    m_gridrow = Lianja.getelementByID("productos_cot")
    m_gridrow.setListItem(1, 1,"fdsdfs|232|23|34|34|34")
    results:
    Code:
    **** Lianja error ****
    m_gridrow.setListItem(1, 1,"fdsdfs|232|23|34|34|34")
    ^
    Data type mismatch in parameter list
    A:
    The parameter order is:
    Code:
    caption as Character[, row as Numeric[, column as Numeric]]




    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-02-02 at 04:36.

  3. #3
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    The UP/DN arrow keys move the highlighted row in a grid (Treegrid) on a canvas section. Is it possible in Lianja to detect when the ENTER key is pressed on a specific row. In VFP, this could be done with the KeyPress() event.
    A:
    "Enter/Return" key is pressed it istreated as a double click so you can handle this in the doubleClick delegate.




    All topics in [Answers] alphabetically: https://www.lianja.com/community/sho...ll=1#post13748

    These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.co...gory/treegrid/

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us