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#.
Formatting cells of a DataGridView best place for the code?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- DrewEaston
- Posts: 48
- Last visit: Thu Mar 30, 2023 8:47 am
Re: Formatting cells of a DataGridView best place for the code?
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.
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?
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.