Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am having a registration page where a candidate registers and i am having a screen which displays all the candidates registered names( In Datalist control). the user waits for his turn for the next round and can see his name on display waiting list.
i am having a datetime column with getdate() function in sqlserver .

From the time candidate has registered i want to change background color of particular row i.e if candidate time passes 30 minutes background color of datalist row should be changed to orange and if crosses one hour color should be changes to red..


How do i do this

What I have tried:

i Have been checking with others forums for this but did not get appropriate results.
Posted
Updated 25-Jun-17 23:50pm
Comments
What have you tried?
sachin.vishwa90 22-Jun-17 9:38am    
how frequent does your data in listview changes? does your list view shows only name?
Member 12674660 23-Jun-17 15:49pm    
if changes when the name in listview is changed by user

1 solution

you can achieve this using jquery if you don't need to save the color in database
There is a setInterval function in javascript which runs after every specified second.
you can make use of that function in following order
to know about setInterval

javascript - Looping through list items with jquery - Stack Overflowto loop through list view and get the values


JavaScript
<script>
setInterval(function(){ alert("Hello"); }, 2000);

function changeRowColor(){
 // loop through each row and take the time as string from column
 // compare that time with current time.
 // if time difference is more than x mins or y seconds
 // change the color of row

}

<script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900