I want to highlight the unread records with color in gridview...For ex:I have 4 reports in my Grid view,those are unread records so I want to highlight ,after view the record it should not be highlight.I tried same thing but in my Grid I have 4 reports but only one record is highlighting..Can any one help me how to write the code for this???that is mvc project and I'm using the css to highlight the color like
.ColorChange
{
font-weight: bold !important;
background:#C2E0FF !important;
}
and I'm calling this in code..but it's not working properly Can any one help me please????
priya AvanigaddaPosted Jan 7, 2015, 2:05 AM
if (full.CreatedBy != '@Session["UserId"]') {
if (full.ReptMgr1 == '@Session["UserId"]') {
if (full.RptDisp1 == true) {
$('#Dly' + full.DReportId).addClass('ColorChange');
}
}
else if (full.ReptMgr2 == '@Session["UserId"]') {
if (full.RptDisp2 == true) {
$('#Dly' + full.DReportId).addClass('ColorChange');
}
}
else if (full.ReptMgr3 == '@Session["UserId"]') {
if (full.RptDisp3 == true) {
$('#Dly' + full.DReportId).addClass('ColorChange');
}
}
}
But the problem is Css are not triggering properly
$('#Dly' + full.DReportId).addClass('ColorChange'); ...this condition is not working poperly
Manish Kumar ChoudharyPosted Jan 7, 2015, 1:58 AM
which grid you are using ?
I suggest you add a column to your table say Is_Read by default make it true. When user click on particular row make Is_Read false (means record/row has been read by user)
so that you can access the read and unread row of your grid