Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources


Forums»ASP.NET Forums»



change the color of datagrid

I have one selectall checkbox on grid which selects all the checkboxes for each row in the grid. I have written JS function for it. Not I want the backcolor of the grid to be changed on the event. How do I do that in the JS? Or any other way??

Here is my JS function:

function SelectAllCustomers()
{
// Iterate through the datagrid item (starting from 2).
for (i=2; true; i++)
{
// Get the id of the checkbox for that row.
//var id = "_ctl0_ctlCustomerImpact_dgCustomersImpacted__ctl" + i + "_chkCustomer";
var id = "dgTest__ctl" + i + "_chkCustomer";
// Check if id exists.
if (document.getElementById(id) != null)
{
// If found, set / unset its checked property based on the checked property of Select all checkbox.
document.getElementById(id).checked = document.getElementById('chkAllCustomers').checked;

}
else
{
// Else, exit the loop.
break;
}
}
}
posted by:anonymous on 10/15/2007 11:13:44 PM
© 2008 dotnetwatch.com -- Privacy policy

Website Design & Internet Marketing by Shivam