• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

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
0
mte01
Asked:
mte01
1 Solution
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now