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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Display text and background color based on Gridview cell value

Display text and background color based on Gridview cell value

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldatabase
1 Posts 1 Posters 3 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.
  • S Offline
    S Offline
    samflex
    wrote on last edited by
    #1

    The following code displays master/detail form and when the master is expanded, displays details associated with the master record. It works as expected. Here is that code:

    'HTML
    function expanCollapse(input) {
    var displayIcon = "img" + input;
    if ($("#" + displayIcon).attr("src") == "images/plus.png")
    {
    $("#" + displayIcon).closest("tr")
    .after("<tr><td></td><td colspan = '100%'>" + $("#" + input)
    .html() + "</td></tr>");
    $("#" + displayIcon).attr("src", "images/minus.png");
    } else
    {
    $("#" + displayIcon).closest("tr").next().remove();
    $("#" + displayIcon).attr("src", "images/plus.png");
    }
    }

    		[');">
    			" src="images/plus.png" />](JavaScript:expanCollapse\('div<%# Eval\()
    

    " style="display: none;">

    'VB

    Protected Sub Page\_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    
        If Not Me.IsPostBack Then
    
        End If
        Dim sql As String = "SELECT e.EmployeeID, e.empID, e.employeeName,e.empTitle, e.email "
    
    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