hide column from a datagrid + change rows colors

Hi,
i need to hide a column from a vb.net datagrid.
the datagrid source is a table from the dataset

+

i need to change the color of the rows in this grid, say fst one is blue second white third blue fourth white....

what is the simpler way to do it...
thanks
LVL 3
mte01Asked:
Who is Participating?
 
razorback041Commented:
try this for the column
http://msdn.microsoft.com/library/en-us/dnwinforms/html/wnf_custdatagrid.asp

and for the alternating colors
use the AlternatingBackColor property of the datagrid  ala

DataGrid1.AlternatingBackColor = Yellow
DataGrid1.BackColor = White


0
 
aki4uCommented:
to hide columns, use:
DataGrid.Columns(columnnumber).Visible = False

to change the colors you'll need to add this to html view of your datagrid:
<AlternatingItemStyle BackColor="Blue" ForeColor="White" ></AlternatingItemStyle>
0
 
mte01Author Commented:
Hi aki4u
im talking about the VB.net's datagrid DataGrid.Columns(columnnumber).Visible = False didnt compile
razorback041 methods worked just fine,
thanks for the help anyway aki4u


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.