Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Grid formatting

Posted on 2004-11-02
5
Medium Priority
?
258 Views
Last Modified: 2010-04-15
Hi Experts,

I have DataGrid that is bound by : DataGrid1.DataBind(); command
The question is how to make odd rows white and even rows red ?
Is there built-in method for this ?

Thanks.
0
Comment
Question by:fpoyavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 3

Expert Comment

by:dabitbol
ID: 12474786
Yeah it's the AlternateItemTemplate, just set its color to whatever you want.
0
 
LVL 3

Expert Comment

by:dabitbol
ID: 12474807
Sorry it's: AlternatingItemStyle

Example:
<AlternatingItemStyle BackColor="#66FFFF"></AlternatingItemStyle>

Good Luck
0
 
LVL 3

Expert Comment

by:dabitbol
ID: 12474814
Here's a bigger example:

<asp:DataGrid id="DataGrid1" style="Z-INDEX: 116; LEFT: 624px; POSITION: absolute; TOP: 136px"
                        runat="server">
<AlternatingItemStyle BackColor="#00FFFF"></AlternatingItemStyle>
</asp:DataGrid>
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 total points
ID: 12474864
Are you using VS .Net? if yes then you can do it one of the following way:

1)
Right Click Your DataGrid --> Property Builder --> Format -->  Expand Items
  --> Modify the Alternating Item

2) Use AutoFormat!
Right Click Your DataGrid --> AutoFormat --> Select any...

-tushar
0
 
LVL 3

Expert Comment

by:dabitbol
ID: 12475827
Ahh! Beginners! That's too bad, but it is Experts Exchange, at least the I showed you can be applied everywhere else including VS.NET
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question