Link to home
Start Free TrialLog in
Avatar of LMGONCA
LMGONCAFlag for Portugal

asked on

How to change the color of a datagrid row in VB.NET?

I'm trying to change the full row color for a datagrid in VB.NET?

Can you please explain me how to do this?
Avatar of prakash_prk
prakash_prk
Flag of India image


Are you want to set single row or all rows color ? back color or fore color?

regards
prakash
Avatar of LMGONCA

ASKER

Hi.

1 row based in some criteria in a cell of that row.

Backcolor.

Regards.
LMG
Avatar of 123654789987
123654789987

After <asp:datagrid> declaration u can use

<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>
      <AlternatingItemStyle cssclass="EvenRow"></AlternatingItemStyle>
                                                                        <ItemStyle CssClass="OddRow"></ItemStyle>

In the CssClass u can have the properties of OddRow and EvenRow where u can specify the foreground color

Hi LMGONCA
refer the link

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#Top

Question :  5.14

regards
prakash
Avatar of LMGONCA

ASKER

I've went trought the syncfusion link (in fact I had been exploring the link already) but I don't see any question directly related with mine (if so can you please tell me the number?).

Regards.
LMG
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
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
it is use for changing row color
 Me.DataGrid1.AlternatingBackColor = Color.LightBlue
the code planocz  posted colors only current cell not entire row, and this is almost same as syncfusion's example