Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of razorback041
razorback041
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aki4u
aki4u

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>
Avatar of mte01

ASKER

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