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.
This topic is 5 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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
Last visit: Tue May 16, 2023 6:52 am

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!!
:)
This topic is 5 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked