Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Grid view conditional formatting

Posted on 2013-12-23
3
Medium Priority
?
255 Views
Last Modified: 2014-01-20
Hi,
I have a grid view that has some grouping, is there anyway that where there is commonality between rows that I could highlight the row which has the latest date within it?
Using asp.net
0
Comment
Question by:andyw27
[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
3 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39737932
Probably. Can you provide a bit more info about how you are populating your grid, the data source, whether you are grouping within the grid, or at the datasource, etc?
0
 
LVL 8

Accepted Solution

by:
johny_bravo1 earned 2000 total points
ID: 39744815
You can use the RowDataBound event for formatting your gridview.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
  // Check if row is data row, not header, footer etc.
  if (e.Row.RowType == DataControlRowType.DataRow)
  {
//access your boundfield or templatefield values
  }
}
0
 

Author Comment

by:andyw27
ID: 39759367
Hi,

I have a grid view which is populated like this:

25102      Attr1      Dec 23 2012 3:48PM
25102      Attr1      Jul 5 2012 11:45AM
10009      Attr2      Jan 6 2014 1:19PM
10009      Attr2      Dec 24 2013 8:10AM
10009      Attr2      Dec 23 2013 3:48PM
11759      Attr3      Jul 5 2012 11:45AM


What I’d like to do is to apply some conditional formatting to it so that it highlights the latest value where column 1 & 2 are the same:  Thus in the case above it would look like this:

25102      Attr1      Dec 23 2012 3:48PM      Highlight Row
25102      Attr1      Jul 5 2012 11:45AM      
10009      Attr2      Jan 6 2014 1:19PM      Highlight Row
10009      Attr2      Dec 24 2013 8:10AM      
10009      Attr2      Dec 23 2013 3:48PM      
11759      Attr3      Jul 5 2012 11:45AM      Highlight Row


Can’t figure out what the logic should be?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

718 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