[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Change gridview cell color and column color

Asked by neonlights in C# Programming Language, Programming for ASP.NET

Tags: gridview, color, cell, change

hello....

ASP.net, C#.
I have a gridview with a crosstab access query.  

It is a attendance spreadsheet.
Name, 01 (Sun) 02 (Mon) 03 (Tue) ........ upto Date 15
The data is displaying pretty good, except that I would like to change some colors for:

1) I would like to go thru the headers (since I have not created them) - and check for "Sat" and "Sun" and change the Column color to beige.. (eg)

2) Then, I would like to go thru the rows and see if I have any data in the cells for employees, and if it is, I would like to color code them by each text in that cell.
O - off, V - Vacation, S-sick

so far, I have,

When I uploaded the data to the gridview, I also extract the column headers in a class.

This gives me all the column headers.
----------------------------------------------
public GridViewColumnHeadersList GetGridHeaders(OleDbDataReader dr)
        {
            GridViewColumnHeadersList gridviewcolumnheaderslist = new GridViewColumnHeadersList();
            if (DBReader.HasRows == true)
            {
                for (int i = 1; i <= DBReader.FieldCount-1; i++)
                {
                    if (DBReader.GetName(i) != "Employee Name")
                    {
                        gridviewcolumnheaderslist.Add(new GridViewColumnHeaders(DBReader.GetName(i)));
                    }

                }
            }
            return gridviewcolumnheaderslist;
        }

Then, in my form, I have create RowCreated
-----------------------------------------------------
protected void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            ds.goThruGrid(e,GridView1);
        }

/// I am here now... .need help....
******************************
******************************
public void goThruGrid(System.Web.UI.WebControls.GridViewRowEventArgs e, GridView grd)
        {
            int x = 0;
            string sun = "Sun";
            string sat = "Sat";
            if (null != grdlist)
            {
                foreach (GridViewColumnHeaders c in grdlist)
                {
                    x = x + 1;
                    if (e.Row.RowType == DataControlRowType.Header)
                    {
                        foreach (TableCell Tc in e.Row.Cells)
                        {
                            if (Tc.Text == c.col_Name)
                            {
                                if ((c.col_Name.Substring(4,3) == sun) || (c.col_Name.Substring(4,3) == sun))
                                {
                                   
                                }

                            }
                            else
                            {

                            }

[+][-]12/10/07 02:16 PM, ID: 20445793Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/10/07 02:51 PM, ID: 20446029Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: C# Programming Language, Programming for ASP.NET
Tags: gridview, color, cell, change
Sign Up Now!
Solution Provided By: RockHead
Participating Experts: 2
Solution Grade: B
 
[+][-]12/10/07 04:12 PM, ID: 20446396Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/10/07 05:03 PM, ID: 20446552Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628