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. applying different styles to item and alternating item in datagrid

applying different styles to item and alternating item in datagrid

Scheduled Pinned Locked Moved ASP.NET
wpfquestion
2 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.
  • V Offline
    V Offline
    Vipin d
    wrote on last edited by
    #1

    Hi, In my datagrid, i use one column as template column.In that template column i use hyperlink.I need to apply different styles to items and allternating to this hyperlink. I know applying styles to items and alternating items. But really confused in the above situation..:^) any suggestions???

    All I ever wanted is what others have....
    CrazySanker

    V 1 Reply Last reply
    0
    • V Vipin d

      Hi, In my datagrid, i use one column as template column.In that template column i use hyperlink.I need to apply different styles to items and allternating to this hyperlink. I know applying styles to items and alternating items. But really confused in the above situation..:^) any suggestions???

      All I ever wanted is what others have....
      CrazySanker

      V Offline
      V Offline
      Vipin d
      wrote on last edited by
      #2

      Hi , I got one solution,but i dont know is it correct or not..Anyway its working.. protected void DGShowCount_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header & e.Item.ItemType != ListItemType.Footer) { HyperLink HprWiat = (HyperLink)e.Item.Cells[1].FindControl("HprWiat"); if (e.Item.ItemType == ListItemType.AlternatingItem) { HprWiat.CssClass = "Pendinglink"; } else { HprWiat.CssClass = "Pendinglink1"; } } }

      All I ever wanted is what others have....
      CrazySanker

      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