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. General Programming
  3. Visual Basic
  4. how change row color on(in) datagirid

how change row color on(in) datagirid

Scheduled Pinned Locked Moved Visual Basic
databasequestion
6 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.
  • B Offline
    B Offline
    berzegerol
    wrote on last edited by
    #1

    hi guys, i am using sqlserver and datagrid. i want to change to the rows color while aplication runnig and i specially want to change the color of row that in the index that i specified with writing code how can i do this thanks..

    J 1 Reply Last reply
    0
    • B berzegerol

      hi guys, i am using sqlserver and datagrid. i want to change to the rows color while aplication runnig and i specially want to change the color of row that in the index that i specified with writing code how can i do this thanks..

      J Offline
      J Offline
      Janani Divya
      wrote on last edited by
      #2

      Ya u can change the row color by using For all rows: DataGrid1.DefaultCellStyle.BackColor = Color.DarkGray For alternating row style: DataGrid1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige Janani

      B 1 Reply Last reply
      0
      • J Janani Divya

        Ya u can change the row color by using For all rows: DataGrid1.DefaultCellStyle.BackColor = Color.DarkGray For alternating row style: DataGrid1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige Janani

        B Offline
        B Offline
        berzegerol
        wrote on last edited by
        #3

        thakn you but i want to change only one row. for example DataGrid1.CurrentRowIndex = 3 i want to change this row. and there not AlternatingRowsDefaultCellStyle ana DefaultCellStyle in datagrid of peculiarity or there? if there, how can i use?

        J 1 Reply Last reply
        0
        • B berzegerol

          thakn you but i want to change only one row. for example DataGrid1.CurrentRowIndex = 3 i want to change this row. and there not AlternatingRowsDefaultCellStyle ana DefaultCellStyle in datagrid of peculiarity or there? if there, how can i use?

          J Offline
          J Offline
          Janani Divya
          wrote on last edited by
          #4

          This is for changing the particular row color. Try it: DataGrid1.Rows(3).DefaultCellStyle.BackColor = Color.Azure For which row, u want, change the row value only.

          B 1 Reply Last reply
          0
          • J Janani Divya

            This is for changing the particular row color. Try it: DataGrid1.Rows(3).DefaultCellStyle.BackColor = Color.Azure For which row, u want, change the row value only.

            B Offline
            B Offline
            berzegerol
            wrote on last edited by
            #5

            excuse me..i didnt write this.i use vb.net. i cant this in vb.net DataGrid1.Rows(3).DefaultCellStyle.BackColor = Color.Azure

            J 1 Reply Last reply
            0
            • B berzegerol

              excuse me..i didnt write this.i use vb.net. i cant this in vb.net DataGrid1.Rows(3).DefaultCellStyle.BackColor = Color.Azure

              J Offline
              J Offline
              Janani Divya
              wrote on last edited by
              #6

              This is in VB.net only. I worked out. It was changing the particular row.

              Janani

              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