Question Need help with datagridview

magiccity77

New member
Joined
Feb 16, 2009
Messages
2
Programming Experience
3-5
I would like to know how I can show and hide data based off of a value in a column.

Example.
My table has 3 columns Name, Password, and Tel#

:pseudo Code

if column("Name") or Column(0).Row(0) = "Shawn" then
. Column(1).Row(0).Forecolor = System.Highlight
. Column(2).Row(0).Forecolor = System.Highlight
else
. Column(1).Row(0).style.Forecolor = defaultcellstyle.forcolor . Column(2).Row.style.Forecolor = defaultcellstyle.forcolor
END IF

I placed my code in the rowprepaint event of the datagridview and on start up I get the results I am looking for. However, if the user selects the row or a cell in the row then the value will display.

I don't want the value to show even if the row or cell is selected.
 

Latest posts

Back
Top