Imran
  • Imran
  • Member Topic Starter
2017-04-11T16:58:06Z
I've got a mix of users, some are using "Ultra HD" displays like Surface Pro 4's etc. Others are using standard definition (1600x900ish). The latest version of iGrid fixed the Ultra HD display issues but I have some other issues related to column width and the LayoutCol property of grids. Across my application I have many grids, personalized column and sort layouts can be saved and multiple layouts can be saved for one grid while letting you specify a default layout. When someone upgrades to an ultra HD display, these saved layouts don't work well anymore, if a column was saved at 50 pixels on a standard display, it needs to be around 100 pixels on an Ultra HD display. The LayoutCol properties are saved in the database, any tips on how to convert these saved properties so they work well with and UHD display? I think I basically want to double the width of all the columns.

Is the technical format of that property documented? It looks like this:
1|Width|112|1|Order|1|1|Visible|0|2|Width|181|2|Order|2|2|Visible|1|3|Width|64|3|Order|3|3|Visible|0|

It looks like it is ColumnKey|Property|Value but what is the "Order" property represent?
Also does the order matter or could I have:
1|Width|112|2|Width|181|3|Width|64|

What if I omit properties like Order or Visible?

Thanks!
Imran
Igor/10Tec
2017-04-12T07:23:10Z
The LayoutCol property was created many years ago, when nobody thought about using our controls on screens with high DPI values. It just saves and restores the column widths in pixels regardless of the current monitor's DPI.

To solve the problem, we need to save the current DPI when we read the LayoutCol string and process it accordingly when we restore the column layout: column widths must be recalculated if the DPI has changed. I will think whether this can be done automatically in iGrid and if it's possible, I will implement it in the next big update of the control. Obviously, this will require a change in the LayoutCol string template, so I will need to think how to make it work for layout strings generated in previous builds of iGrid.

If you need an urgent workaround and ready to code it yourself, you need to take into account what I wrote above. And sure, you need to know the format of the LayoutCol string. You have the source code of iGrid so you can always see how a method or property is implemented. The Get accessor for LayoutCol is simple:

Public Property Get LayoutCol() As String
   Dim s As String
   Dim iCol As Long
   
   For iCol = 1 To m_lColCount
      s = s & iCol & LAYOUT_SEP & "Width" & LAYOUT_SEP & ColWidth(iCol) & LAYOUT_SEP _
         & iCol & LAYOUT_SEP & "Order" & LAYOUT_SEP & ColPos(iCol) & LAYOUT_SEP _
         & iCol & LAYOUT_SEP & "Visible" & LAYOUT_SEP & IIf(ColVisible(iCol), "1", "0") & LAYOUT_SEP
   Next
   
   LayoutCol = s
End Property

LAYOUT_SEP is the vertical line separator "|", iCol is the ordinal number of the column on the screen. As you can see, the number following the Order parameter is the value of the ColPos() property for the corresponding column.

The algorithm that processes assignments to LayoutCol is more complex, but it expects all these column parameters (Width, Order, Visible) to be present - and better in the same original order.
Imran
  • Imran
  • Member Topic Starter
2017-04-12T16:56:47Z
Thanks Igor,
The information you provided really helps me understand this issue better. It is more than just doubling the pixel width of columns, I need to understand what the DPI of the OS is when the column width is set. I only now realized that this is not a high resolution issue but it instead it is this DPI setting in the OS. I assume this is the where you adjust the setting in the OS 100%, 125%, 150% etc.

I also now realize that this issue is more than just a LayoutCol property issue but anywhere in my app where I set column widths I need to take into account the DPI setting. I will start another post about that :)

Regarding this issue however, I'm not 100% sure how the DPI setting works or is reported but instead of storing it with the LayoutCol property couldn't you always convert the width values to the DPI setting of 100%.
So on the Get
Inspect the current system DPI, Pull Column Widths, Scale the width to 100%, return.
On the Set
Inspect the current system DPI, Scale the sent widths to x%, set the columns appropriately.

Imran

Igor/10Tec
2017-06-08T15:26:34Z
I have improved the behavior of LayoutCol for high-resolution screens. Check your mailbox, it should already contain a link to the new build of iGrid with this improvement to test.
Igor/10Tec
2017-06-19T10:14:48Z
The latest public update of iGrid, v6.5.72, already implements this enhancement.