Combining two cell values and checking Active Directory.

Ask your 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.
jvierra
Posts: 14578
Joined: Tue May 22, 2007 9:57 am
Answers: 1
Been upvoted: 1 time
Contact:

Re: Combining two cell values and checking Active Directory.

Post by jvierra »

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

User avatar
mxtrinidad
Posts: 399
Joined: Sun Mar 03, 2013 12:42 pm

Re: Combining two cell values and checking Active Directory.

Post by mxtrinidad »

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