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. Change the style of DataGrid row

Change the style of DataGrid row

Scheduled Pinned Locked Moved ASP.NET
questioncsharpvisual-studio
4 Posts 3 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.
  • C Offline
    C Offline
    coolpali_girl
    wrote on last edited by
    #1

    Hi there.. How can i change the DataGrid row color and style when i click this row? VS.NET\VB.NET

    S C 2 Replies Last reply
    0
    • C coolpali_girl

      Hi there.. How can i change the DataGrid row color and style when i click this row? VS.NET\VB.NET

      S Offline
      S Offline
      sathish s
      wrote on last edited by
      #2

      To change datagrid row color, use this code

      Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemCreated
      e.Item.Attributes.Add("Onclick", "this.style.backgroundColor = 'lightblue';")
      End Sub

      C 1 Reply Last reply
      0
      • C coolpali_girl

        Hi there.. How can i change the DataGrid row color and style when i click this row? VS.NET\VB.NET

        C Offline
        C Offline
        cheeken2u
        wrote on last edited by
        #3

        If you using visio studio to create it, you can simply change the style by 1. select the datagrid 2. open the properties windows 3.click the Auto Format at there you can chose the predefined style of the datagrid. hope you can find it.:-D

        1 Reply Last reply
        0
        • S sathish s

          To change datagrid row color, use this code

          Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemCreated
          e.Item.Attributes.Add("Onclick", "this.style.backgroundColor = 'lightblue';")
          End Sub

          C Offline
          C Offline
          coolpali_girl
          wrote on last edited by
          #4

          Thanx :-D

          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