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. C#
  4. Row selection for datagrid control

Row selection for datagrid control

Scheduled Pinned Locked Moved C#
comtutorialquestion
4 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.
  • E Offline
    E Offline
    eric feng
    wrote on last edited by
    #1

    Any one knows how to make the datagrid select the whole row when the mouse click on it? just like a list box. Thanks. eric feng www.infospec.com

    A 1 Reply Last reply
    0
    • E eric feng

      Any one knows how to make the datagrid select the whole row when the mouse click on it? just like a list box. Thanks. eric feng www.infospec.com

      A Offline
      A Offline
      A Wegierski
      wrote on last edited by
      #2

      Override mouse events and select row AFTER calling base method. public ... override ... OnMouse...(...) { base.OnMouse...(...); this.Select(...) } Hi, AW

      E 1 Reply Last reply
      0
      • A A Wegierski

        Override mouse events and select row AFTER calling base method. public ... override ... OnMouse...(...) { base.OnMouse...(...); this.Select(...) } Hi, AW

        E Offline
        E Offline
        eric feng
        wrote on last edited by
        #3

        this works, but when scroll the grid, the cell goes into edit mode. eric feng www.infospec.com

        A 1 Reply Last reply
        0
        • E eric feng

          this works, but when scroll the grid, the cell goes into edit mode. eric feng www.infospec.com

          A Offline
          A Offline
          A Wegierski
          wrote on last edited by
          #4

          I have no this trouble - I use overridden column style. Try to override next events ... may be OnScroll() (save selected row numbers, call base method and restore selection I think). Next trouble is with sorting. Previous algorithm doesn't work :confused:. Hi, AW

          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