Combining two cell values and checking Active Directory.

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
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.
User avatar
jvierra
Posts: 12545
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Combining two cell values and checking Active Directory.

Post by jvierra » Thu May 17, 2018 11:34 am

Easier than you first though. Glad you got it to work.

User avatar
mxtrinidad
Site Admin
Posts: 170
Joined: Sun Mar 03, 2013 12:42 pm

Re: Combining two cell values and checking Active Directory.

Post by mxtrinidad » Thu May 17, 2018 1:01 pm

Or, you could use column names and highlight the whole line with the cell with issue:

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';
		}

Very cool stuff!!
:)

Locked