Page 2 of 2

Re: Formatting cells of a DataGridView best place for the code?

Posted: Wed Aug 07, 2019 11:40 am
by jvierra
Very nice. You don't need some of the code.

This does what you are trying to do:

If ($this.Columns[$_.ColumnIndex].Name -eq 'ARTIST') {

"-eq" is case insensitive and behaves better then the object method. Be careful with that when using C# code for an example. Much of what we can do easily in PowerShell cannot be done in C#.

Re: Formatting cells of a DataGridView best place for the code?

Posted: Thu Aug 08, 2019 9:49 am
by DrewEaston
Hi jvierra,

Thanks again that experience that you are share is the value of GOLD.
I will use that, that a somewhat of a habit coming from VBS I have not programmed in C# and I have not programmed in C since 2002. Mainly java and other languages.

Re: Formatting cells of a DataGridView best place for the code?

Posted: Thu Aug 08, 2019 11:05 am
by jvierra
There is only one good book on programming with Windows Forms and it is in C#/VB.Net. It is still very useful. Once you see how to map PS onto C# examples then Forms are very easy. WPF is more powerful but much harder to work with.