kgerb
asked on
Flex Grid Scrollbars Value Won't Change
I am trying to determine the value of the scrollbars property so that I know how wide make the last column in my Flex Grid. The problem is that it doesn't matter how wide or long the data is in the grid, the value of .scrollbars is always 3 (both Hor. and Ver.). I have tested it where the grid is filled with a single row of data that extends about half way accross the control but the .scrollbars property still returns 3? Anybody have any ideas why the grid isn't recognizing that Hor or Vert scrollbars are not needed?
Here's my code:
Select Case .ScrollBars
Case 0 'No Scrollbars
If ColWidth < ((.Width * 20) - 100) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 100
End If
Case 1 'Only Horizontal
'Do Nothing
Case 2 'Only Vervical
If ColWidth < ((.Width * 20) - 360) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 360
End If
Case 3 'Both Horizontal and Vertical
If ColWidth < ((.Width * 20) - 360) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 360
End If
End Select
Thanks so much,
Kyle
Here's my code:
Select Case .ScrollBars
Case 0 'No Scrollbars
If ColWidth < ((.Width * 20) - 100) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 100
End If
Case 1 'Only Horizontal
'Do Nothing
Case 2 'Only Vervical
If ColWidth < ((.Width * 20) - 360) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 360
End If
Case 3 'Both Horizontal and Vertical
If ColWidth < ((.Width * 20) - 360) Then
.ColWidth(.Cols - 1) = (.Width * 20) - ColWidth - 360
End If
End Select
Thanks so much,
Kyle
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both for you responses! Very informative!
Z03niE,
Thanks for the snippet. I have a very similar procedure that measures the width of all columns
So, is summing the width of all the rows and comparing that value to the height of the grid control the only way to determine if the grid has a vertical scrollbar ? Or I guess you could count the rows and say if the number of rows is greater than x there will be a vertical scrollbar. Is "measuring" the height and width of the data the only way to determine if Hor and Ver scrollbars are needed? Not that I am unwilling to take that approach. I'm just wondering if there is a property for this.
Thanks so much!
Z03niE,
Thanks for the snippet. I have a very similar procedure that measures the width of all columns
So, is summing the width of all the rows and comparing that value to the height of the grid control the only way to determine if the grid has a vertical scrollbar ? Or I guess you could count the rows and say if the number of rows is greater than x there will be a vertical scrollbar. Is "measuring" the height and width of the data the only way to determine if Hor and Ver scrollbars are needed? Not that I am unwilling to take that approach. I'm just wondering if there is a property for this.
Thanks so much!
Take a look at this PAQ:
https://www.experts-exchange.com/questions/20304235/Flexgrid-scrollbars.html
Idle_Mind
https://www.experts-exchange.com/questions/20304235/Flexgrid-scrollbars.html
Idle_Mind
ASKER
Sorry it's taken so long. Thank you both very much. I appreciate your help.
ASKER