in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Moving Node

Last post 05-16-2008 7:16 AM by Wolfgang Knauf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-12-2008 12:59 AM

    Moving Node

    How to move a node and its child to to a new location in a grid.(Row wise movement)

    I used node.move method, but the node and its children can be moved only to one position up or down (nodemoveenum)

  • 05-16-2008 7:16 AM In reply to

    Re: Moving Node

    Hi!

    You can also move flexgrid rows (not nodes).

    If you want to swap to rows, I can provide you with a bit of code. Hope this helps

    Wolfgang

    =======================

    public static void SwapRow(C1FlexGrid _flexGrid, int _intRow1, int _intRow2)
    {
    if (_intRow1 == _intRow2)
    return;

    if (_intRow1 > _intRow2)
    {
    int intTemp = _intRow1;
    _intRow1 = _intRow2;
    _intRow2 = intTemp;
    }
    //Swap Row1 with it's neighbour until we reach Row2:
    for (int intIndexRow = _intRow1; intIndexRow
    {
    _flexGrid.Rows.Move(intIndexRow, intIndexRow + 1);
    }

    //Now backwards: move row2 to it's target position:
    for (int intIndexRow = _intRow2 - 1; intIndexRow > _intRow1; intIndexRow--)
    {
    _flexGrid.Rows.Move(intIndexRow, intIndexRow - 1);
    }
    }
Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.