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

Notification

Icon
Error

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

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:
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

Edited by moderator Thursday, June 22, 2017 6:22:20 AM(UTC)  | Reason: Igor/10Tec: changed post status to 'solved'

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

Rank: Administration

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

Thanks: 11 times
Was thanked: 111 time(s) in 111 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:

Code:
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  
#3 Posted : Wednesday, April 12, 2017 4:56:47 PM(UTC)
Imran

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.

Imran

Igor/10Tec  
#4 Posted : Thursday, June 8, 2017 3:26:34 PM(UTC)
Igor/10Tec

Rank: Administration

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

Thanks: 11 times
Was thanked: 111 time(s) in 111 post(s)
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  
#5 Posted : Monday, June 19, 2017 10:14:48 AM(UTC)
Igor/10Tec

Rank: Administration

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

Thanks: 11 times
Was thanked: 111 time(s) in 111 post(s)
The latest public update of iGrid, v6.5.72, already implements this enhancement.
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.