Support Forums

Search found 9738 matches

by jvierra
Thu Sep 29, 2016 11:07 am
Forum: PowerShell GUIs
Topic: Hashtable in Datagridview, how to order the columns
Replies: 2
Views: 21

Re: Hashtable in Datagridview, how to order the columns

Without a sampleof your code this is not going to be answerable. Normally hashtables cannot be displayed in a grid. You would need to convert to an object and then make an arraylist. The gash can be ordered by using the [ordered] word. $hash=[ordered]@{ ... } Just add a column after the grid is load...
by jvierra
Thu Sep 29, 2016 6:54 am
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

I think this is what you are trying to do. It is really much simpler than you know: $CSVSourceDir = 'OOBResults.csv' $data = Import-CSV $CSVSourceDir Add-Type -AssemblyName System.Windows.forms $form = New-Object system.Windows.forms.form $form.Text = 'OOB Results' $form.Size = '...
by jvierra
Thu Sep 29, 2016 6:33 am
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

Well the way to enumerate a grid is as follows: foreach($row in $datagrid.Rows){ if($row.Cells['Result'].Value -eq 'NO CARRIER'){ foreach($cell in $row.Cells){ $cell.Style.ForeColor = 'Red' } } } No need for indexing or guessing at column numbers. Form...
by jvierra
Thu Sep 29, 2016 6:20 am
Forum: Windows PowerShell
Topic: Make exe
Replies: 6
Views: 88

Re: Make exe

If you run under alternate credentials then you are running as that user. You cannot give a standard user admin privileges. You can run a program as another user.
by jvierra
Wed Sep 28, 2016 9:55 pm
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

Example:

$datagridview.Rows[0].Cells[0].Style.BackColor = 'Red'
by jvierra
Wed Sep 28, 2016 9:50 pm
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

Write-Output does not change colors.. What are you trying to do? Did you read all of the link I posted?

You cannot change the row color. YOU can only change cell colors. Changing the default color does not work.
by jvierra
Wed Sep 28, 2016 8:58 pm
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

I have no idea what that is supposed to mean. I thought you were asking about adding colors to a row.
by jvierra
Wed Sep 28, 2016 7:21 pm
Forum: Windows PowerShell
Topic: DataGridView Row Color
Replies: 12
Views: 71

Re: DataGridView Row Color

The easiest way to set the cells color after loading the grid. Just enumerate the cells of the row and set color based on key cell.

Here is a simple example: https://powershell.org/forums/topic/cha ... agridview/
by jvierra
Wed Sep 28, 2016 6:37 pm
Forum: PowerShell GUIs
Topic: Validating event not called
Replies: 4
Views: 28

Re: Validating event not called

Well - I cannot guess at what you are doing. Trying rebuilding the form from scratch. Perhaps the file is corrupt.
by jvierra
Wed Sep 28, 2016 4:53 pm
Forum: PowerShell GUIs
Topic: Validating event not called
Replies: 4
Views: 28

Re: Validating event not called

validation is disabled.
The event is not tied to the control.

Go to advanced search