Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve grid resizing in ConvertTo-WPFGrid #36

Closed
jdhitsolutions opened this issue Mar 6, 2019 · 18 comments
Closed

Improve grid resizing in ConvertTo-WPFGrid #36

jdhitsolutions opened this issue Mar 6, 2019 · 18 comments
Assignees
Labels
enhancement in progress work is in progress on this issue

Comments

@jdhitsolutions
Copy link
Owner

When resizing the form the grid should resize with it.

@jdhitsolutions
Copy link
Owner Author

This should be handled in v2.4.0

@jdhitsolutions jdhitsolutions added the in progress work is in progress on this issue label Mar 6, 2019
@jdhitsolutions jdhitsolutions self-assigned this Mar 6, 2019
@jdhitsolutions
Copy link
Owner Author

As of v2.5.0 I'm satisfied with how the grid and form resize. It works as i expect it to. But I'll leave this issue open for a bit in case someone wants to convince me otherwise.

@scriptingstudio
Copy link

One more issue is left. The form is still not resizable. What am I doing wrong?
I dont modify the function and call it like this:
$datapath = (resolve-path $PSscriptRoot\pcmon\pcmon.csv).path
import-csv $datapath -encoding default -delimiter ';' | ConvertTo-WPFGrid -timeout 40 -refresh -title 'PC Monitor' -var datapath
I use PS 5.1 on Windows 10 1809

@jdhitsolutions
Copy link
Owner Author

Do you get anything in the form? Have you tried with a different command like get-service | select name,status,displayname | convertto-wpfgrid

@jdhitsolutions
Copy link
Owner Author

jdhitsolutions commented Mar 12, 2019

Also make sure your scriptroot isn't in a profile defined PSDrive. Or use Convert-Path instead of Resolve-Path.

@scriptingstudio
Copy link

Yes my form is filled.

just tested get-service | select name,status,displayname | convertto-wpfgrid
I can resize the form horizontaly only.

@scriptingstudio
Copy link

if I dont use var import the form can be resizable horizontally.

@jdhitsolutions
Copy link
Owner Author

If you grab the lower right corner of the form you should be able to drag and resize in any direction.

@scriptingstudio
Copy link

Now it is true. Such a resizing style is so tricky :-))
Only angles are active and only for reducing. Is it possible to make it maximize and increase?

@jdhitsolutions
Copy link
Owner Author

I've set a maximum size to be a percentage of the totally available screen space. You can click the maximize windows control icon in the top right. if you have more data than that then you'll need to live with the scroll bars.

@scriptingstudio
Copy link

Maximize control does nothing useful. Maximum window size is limited in your function.

The window size should match data size. If the data fit in the window it cannot be maximized. If the data does not fit in the screen the window can be resized any direction with data size in mind.

I have no idea if WPF form can be configured that way.

@jdhitsolutions
Copy link
Owner Author

Removing the limits make the form ugly to work. If you have a lot of data to display, more than will fill your available screen space, the edges of the form bleed off and it is tricky to grab something to resize. I suppose I could look at increasing the max size of the form. I think I have some work to work with.

@jdhitsolutions
Copy link
Owner Author

I increased the max form size in v2.6.0 which I think is about the best I can do with sizing issues.

@scriptingstudio
Copy link

works perfect.
Can you tell me what is the setting for a form to remove cell borders? I am lazy to explore documentation.

@jdhitsolutions
Copy link
Owner Author

I think this will modify it

$datagrid.GridLinesVisibility =[system.windows.controls.datagridGridLinesVisibility]::All

@jdhitsolutions
Copy link
Owner Author

I can see where that might make a nice cosmetic difference.

@jdhitsolutions
Copy link
Owner Author

I've added a parameter which you'll see in v2.7.0

@jdhitsolutions
Copy link
Owner Author

I think I've done about all I can on resizing issues for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in progress work is in progress on this issue
Projects
None yet
Development

No branches or pull requests

2 participants