Click here to Skip to main content
13,457,429 members
Click here to Skip to main content
Add your own
alternative version


4 bookmarked
Posted 28 Dec 2011

Click/select Row in ASP.NET GridView or HTML Table

, 28 Dec 2011
Rate this:
Please Sign up or sign in to vote.
Following are optimized code for SelectRow functionStylesheet.selectedRow{color: #303030;font-size:3em;font-weight:bold;}.normalRow{color: #909090;font-size:2em;font-weight:normal;}Javascriptfunction SelectRow(row) { // get all data rows - siblings to...
Following are optimized code for SelectRow function

color: #303030;
color: #909090;

function SelectRow(row) {
  // get all data rows - siblings to current
  var _rows = row.parentNode.childNodes;
  // deselect all data rows
  try {
     for (i = 0; i < _rows.length; i++) {
  catch (e) { }
  // select current row (formatting applied to first cell)



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


About the Author

Sunasara Imdadhusen
Software Developer (Senior) Infostretch Ahmedabad-Gujarat
India India
Aspiring for a challenging carrier wherein I can learn, grow, expand and share my existing knowledge in meaningful and coherent way.

sunaSaRa Imdadhusen


  1. 2nd Best Mobile Article of January 2015
  2. 3rd Best Web Dev Article of May 2014
  3. 2nd Best Asp.Net article of MAY 2011
  4. 1st Best Asp.Net article of SEP 2010

Read More Articles...

You may also be interested in...

Comments and Discussions

GeneralReason for my vote of 1 loop is the problem if rows will 100... Pin
Technoses30-Dec-11 18:43
groupTechnoses30-Dec-11 18:43 
GeneralRe: Reason for my vote of 1loop is the problem if rows will 100... Pin
Sunasara Imdadhusen22-Apr-14 4:04
professionalSunasara Imdadhusen22-Apr-14 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01-2016 | 2.8.180322.1 | Last Updated 28 Dec 2011
Article Copyright 2011 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid