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. DataList and Border-Collapse

DataList and Border-Collapse

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptquestion
2 Posts 2 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.
  • R Offline
    R Offline
    RX Maverick
    wrote on last edited by
    #1

    Ok, maybe third times a charm. I've posted about this problem before and thought I had an answer but it doesn't work for what I want. Is there anyway to programmatically I can remove the style Border-Collapse:Collapse before the table gets built and sent to the browser? Can I make a Sub that's called by the OnLoad of the DataList or some other On____? I was using javascript that ran on load but it's ugly and inefficient (also with the AJAX I'm using it doesnt always run) EX: document.getElementById('Calendar_DataList1').style.borderCollapse=''; Thanks for any help

    M 1 Reply Last reply
    0
    • R RX Maverick

      Ok, maybe third times a charm. I've posted about this problem before and thought I had an answer but it doesn't work for what I want. Is there anyway to programmatically I can remove the style Border-Collapse:Collapse before the table gets built and sent to the browser? Can I make a Sub that's called by the OnLoad of the DataList or some other On____? I was using javascript that ran on load but it's ugly and inefficient (also with the AJAX I'm using it doesnt always run) EX: document.getElementById('Calendar_DataList1').style.borderCollapse=''; Thanks for any help

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      By design, the DataList control uses the TableStyle to apply the style for the control when it is rendered, and the tablestyle basically will emit the the Border-Collapse stuff when the CellSpacing is 0.So there are a couple of options to work around here: + Assign a value (gt&0) to the CellSpacing property of the control. + Define your own custom TabelStyle and override the CreateControlStyle method of the DataList control. + Override one of the methods called when the control is rendered like Render or RenderContents .... to get rid of the Border-Collapse.

      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