Combining two cell values and checking Active Directory.
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.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Combining two cell values and checking Active Directory.
Or, you could use column names and highlight the whole line with the cell with issue:
Very cool stuff!!
Code: Select all
## - Button Click event:
:
Update-DataGridView -DataGridView $datagridview1 -Item $x -AutoSizeColumns DisplayedCells;
foreach ($i in $datagridview1.rows) {
## - Section to highlightline and columns:
if (($i.Cells['Name'].Value).ToString() -match 'psf') {
$datagridview1.Rows[($i.Cells['Name']).RowIndex].DefaultCellStyle.BackColor = 'Bisque';
$i.Cells['Name'].Style.BackColor = 'Magenta';
}