![ultratree starts like this](Images/WinTree_Moving_Columns_in_the_WinTree_01.png)
With the addition of column support in Ultimate UI for Windows Forms 2005 Volume 2, WinTree™ also supports the ability to reposition columns. Columns may be repositioned programmatically by changing the OriginX and OriginY of each column’s LayoutInfo . In addition, end-users may reposition columns by dragging and dropping column headers.
You can prevent end-users from being able to reposition columns on a per-column basis (using the column’s AllowMoving ), for all columns in a ColumnSet (using the UltraTreeColumnSet’s AllowColMoving ) or for all ColumnSets (using the UltraTreeColumnSetting’s AllowColMoving property).
We will start with a WinTree that looks similar to the one shown in the screen shot below.
To move a column, press the left mouse button down on a column header and drag the column to its new location. As you drag the column header, drop indicators (a pair of red arrows when positioning the item adjacent to another column or a red rectangle when dropping the column into an empty slot) will be displayed to indicate that you are over a valid drop location.
For example if you want to have the "First Name" column before the "Last Name" column, click on "First Name" column header and drag it over the "Last Name" column header. When you are over the left edge of the "Last Name" column header, red arrows similar to that displayed in the screenshot below will be displayed along the leading edge of the column indicating that the "First Name" column will be positioned to the left of the "Last Name" column.
When the mouse is released, the column will be repositioned based on the location of the red drop indicators.