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. VB.Net 2003 DataGrid Cell Selection

VB.Net 2003 DataGrid Cell Selection

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
2 Posts 2 Posters 2 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.
  • F Offline
    F Offline
    ford86
    wrote on last edited by
    #1

    Hi everyone, I've been trying to select (from the code) a specific cell in the DataGrid control to change it's value. Exemple: if [cell].text = "" then [cell].text = "0" I didn't actually find a way to do that. Can someone help me out? Thanks!

    R 1 Reply Last reply
    0
    • F ford86

      Hi everyone, I've been trying to select (from the code) a specific cell in the DataGrid control to change it's value. Exemple: if [cell].text = "" then [cell].text = "0" I didn't actually find a way to do that. Can someone help me out? Thanks!

      R Offline
      R Offline
      Rahithi
      wrote on last edited by
      #2

      Hi, look at this code, i am checking the cell value when i am binding the data ....and if it is empty, then i am displaying it as '0' hope this will give you some idea resolve your problem!! Private Sub YourDataGridName_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles YourDataGridName.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then If e.Item.Cells(0).text="" then e.Item.Cells(0).text=0 End if end sub Thanks, Rahi

      If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      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