Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
UltraTreeNodeColumn.LayoutInfo.OriginX property units
posted

What units does the UltraTreeNodeColumn.LayoutInfo.OriginX property represent? And what are the units relative to?

The description states it is the X coordinate in the virtual grid. What is the virtual grid?

I am adding a checkbox column and image column to a databound grid. I set the OriginX property to 0 for the checkbox because I would like it to be the first column. And, I set the OriginX property to 1 for the image column because I would like it to be the second column. Well, the checkbox is the first column, but now the image is below the checkbox?

I had to set the OriginX property to 2 for the image column to make it appear as the second column. Why?

Here is a snipit of code:

private void treeHierarchy_ColumnSetGenerated(object sender, ColumnSetGeneratedEventArgs e)
{

UltraTreeNodeColumn colCheck = new UltraTreeNodeColumn();
colCheck.LayoutInfo.OriginX = 0;
e.ColumnSet.Columns.Add(colCheck);


UltraTreeNodeColumn colImage = new UltraTreeNodeColumn();
colImage.LayoutInfo.OriginX = 2;
e.ColumnSet.Columns.Add(colImage);

}

  • 469350
    Verified Answer
    Offline posted

    ocajuno said:

    What units does the UltraTreeNodeColumn.LayoutInfo.OriginX property represent? And what are the units relative to?

    The description states it is the X coordinate in the virtual grid. What is the virtual grid?

    I am adding a checkbox column and image column to a databound grid. I set the OriginX property to 0 for the checkbox because I would like it to be the first column. And, I set the OriginX property to 1 for the image column because I would like it to be the second column. Well, the checkbox is the first column, but now the image is below the checkbox?

    The units are logical columns. The logical columns are created by the layout as a whole and are calculated based on the items within the layout.

    I'm probably not describing it very well. The RowLayouts use a concept called a GridBagLayout. I'm sure if you do a search on the internet there are web sites out there that describe GridBagLayouts better than I can.

    ocajuno said:
    I had to set the OriginX property to 2 for the image column to make it appear as the second column. Why?

    Probably because the default SpanX of every column is 2 by default. The default is 2, because otherwise, if you changed the LabelPosition to Left or Right, the cell contents would disapear.