Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Tuesday, April 11, 2017 4:58:06 PM(UTC)

Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 6
Location: Chicago

Was thanked: 1 time(s) in 1 post(s)
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:

It looks like it is ColumnKey|Property|Value but what is the "Order" property represent?
Also does the order matter or could I have:

What if I omit properties like Order or Visible?


#2 Posted : Wednesday, April 12, 2017 7:23:10 AM(UTC)

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 749

Thanks: 11 times
Was thanked: 98 time(s) in 98 post(s)
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
   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.
#3 Posted : Wednesday, April 12, 2017 4:56:47 PM(UTC)

Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 6
Location: Chicago

Was thanked: 1 time(s) in 1 post(s)
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.


Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.