Search found 13733 matches

by jvierra
Fri Sep 20, 2019 1:38 pm
Forum: PowerShell GUIs
Topic: folderbrowsermoderndialog reverting to non modern on Win 10
Replies: 7
Views: 49

Re: folderbrowsermoderndialog reverting to non modern on Win 10

Here is a simpler method for doing this: $buttonSelect_Click = { switch ($comboboxMoveRegion.SelectedItem) { "1. full name" { $MoveRegionPath = "1. folder name" } "2. full name" { $MoveRegionPath = "2. folder name" } default { $labelMoveResult.Text = "Error: Select a region first" $labelMoveResult.F...
by jvierra
Fri Sep 20, 2019 12:05 pm
Forum: PowerShell GUIs
Topic: folderbrowsermoderndialog reverting to non modern on Win 10
Replies: 7
Views: 49

Re: folderbrowsermoderndialog reverting to non modern on Win 10

It would be helpful if you posted a simplified version of yuour code so that we can see if there is a coding issue that might cause the path variable to be $null or contain a bad value. Post the event and the other form code that manages the variable used to set the default. The FolderBrowserDialog ...
by jvierra
Fri Sep 20, 2019 11:57 am
Forum: PowerShell GUIs
Topic: folderbrowsermoderndialog reverting to non modern on Win 10
Replies: 7
Views: 49

Re: folderbrowsermoderndialog reverting to non modern on Win 10

Thanks for the prompt response. They don't receive any errors that i'm aware of (when I asked they said no), it just opens the folderbrowserdialog to the base "My Computer" location. With this dialog you must test the exisitence of the folder before using it or the problem you are seeing will happe...
by jvierra
Thu Sep 19, 2019 7:12 pm
Forum: PowerShell GUIs
Topic: Datagridview data binding issue while cell value has {}
Replies: 3
Views: 155

Re: Datagridview data binding issue while cell value has {}

You have to covert it into something useful. A byte array is not useful to anyone when displayed.
by jvierra
Wed Sep 18, 2019 5:18 pm
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

Also no`te that the code I posted is intended only to be used when you refresh the data, It will not work as expected if you use it in multiple events. You should have NO events managing the sort or column clicks as they will just create issues.
by jvierra
Wed Sep 18, 2019 5:15 pm
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

If you would just add a DataTable and leave everything else alone my code would work as intended. It is clear that you method of creating and loading the table is not correct for proper functioning of the sort capability. All sorting in a grid is one automatically without any code. The Sort filter g...
by jvierra
Wed Sep 18, 2019 11:01 am
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

You can also save the sort that is currently defined:

$currentsort = $datagridview1.DataSource.DefaultView.Sort
# reload
$datagridview1.DataSource.DefaultView.Sort = $currentsort
by jvierra
Wed Sep 18, 2019 10:55 am
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

Yes = change the SQL and add an "ORDER BY" to the SQL.
by jvierra
Wed Sep 18, 2019 10:45 am
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

When you reload the data add it to the DataTable at that point. Remove the click event.
You an also just add an "ORDER BY" to your SQL and the table will be sorted when it is retrieved.
by jvierra
Wed Sep 18, 2019 10:29 am
Forum: PowerShell GUIs
Topic: Sorting by column in a datagridview
Replies: 12
Views: 130

Re: Sorting by column in a datagridview

Set the sort for the source.

$datatable.DefaultView.Sort = 'Name' # 'Name' is column name.