Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Please Its Urgent (highlight the selected row in nested gridview? [modified])

Please Its Urgent (highlight the selected row in nested gridview? [modified])

Scheduled Pinned Locked Moved ASP.NET
javascriptcsstutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 4659001
    wrote on last edited by
    #1

    I took advantage of some code I found on these forums and have created a form that has a nested gridview. The first gridview is bound using the SqlDataSource and on the OnRowBound event, bind data to the nested gridview. Then using JavaScript i hide the nested gridview until the user clicks on an image. The code I found for the javascript nested grid view is here. I then added code to highlight the selected row in the the first gridview. What i need to know is how would I go about adding code to make it so that I can do the same for the nested gridview? Sample code protected void Page_PreRenderComplete(object sender, System.EventArgs e) { //GridView nestedGrid = (GridView)GridView1.FindControl("GridView2"); foreach (GridViewRow y in GridView1.Rows) { y.Attributes.Add("onclick", "setSelected(this);"); } } function setSelected(selRow) { // alert(selRow.rowIndex); var tbl = document.getElementById("GridView1"); for(var i = 1; i < tbl.rows.length; i++) { if(selRow.rowIndex == i) { selRow.style.fontWeight = "Bold"; selRow.style.backgroundColor = "Yellow"; } } } But once i moved to child grid that time Click event of parent Grid cell does not fired so all highlited row of parent grid gone. so how to solve it

    Raghvendra

    modified on Tuesday, June 30, 2009 12:06 PM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups