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. Cell/Row DoubleClick event for DataGrid

Cell/Row DoubleClick event for DataGrid

Scheduled Pinned Locked Moved C#
helpvisual-studioquestion
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.
  • T Offline
    T Offline
    t4ure4n
    wrote on last edited by
    #1

    Hello guys I have to use datagrid (VS 2003) (not datagridview object) to modify an old project. Prob 1 I need to capture double click event either on the row or the cell in the DataGrid and then read the contents from that row. I have seen the props in the DataGrid object and I can't see any double click events like there are in datagridview object in VS 2005. Prob 2 I need to change the width on individual columns in the DataGrid but can't see any property, but PreferedColumnWidth which sets the size for all the columns. If any body can help me to fix this. It will b highly appreciated.

    o O º(`'·.,(`'·., ?,.·''),.·'')º O o° »·'"`»* *? t4ure4n ?* *«·'"`« °o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°

    N 1 Reply Last reply
    0
    • T t4ure4n

      Hello guys I have to use datagrid (VS 2003) (not datagridview object) to modify an old project. Prob 1 I need to capture double click event either on the row or the cell in the DataGrid and then read the contents from that row. I have seen the props in the DataGrid object and I can't see any double click events like there are in datagridview object in VS 2005. Prob 2 I need to change the width on individual columns in the DataGrid but can't see any property, but PreferedColumnWidth which sets the size for all the columns. If any body can help me to fix this. It will b highly appreciated.

      o O º(`'·.,(`'·., ?,.·''),.·'')º O o° »·'"`»* *? t4ure4n ?* *«·'"`« °o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Problem 1: You'll have to use a little trickery. Inject some javascript that handles the click events on the client side and causes a postback, or a callback as necessary. Problem 2: You'll need to handle the RowCreated event and set the column width there.


      only two letters away from being an asset

      T 1 Reply Last reply
      0
      • N Not Active

        Problem 1: You'll have to use a little trickery. Inject some javascript that handles the click events on the client side and causes a postback, or a callback as necessary. Problem 2: You'll need to handle the RowCreated event and set the column width there.


        only two letters away from being an asset

        T Offline
        T Offline
        t4ure4n
        wrote on last edited by
        #3

        Bro. The app I am woking on is a WinForm and not webbased. second I can't c "RowCreated event" in the event list of DataGrid Object.

        o O º(`'·.,(`'·., ?,.·''),.·'')º O o° »·'"`»* *? t4ure4n ?* *«·'"`« °o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°

        N 1 Reply Last reply
        0
        • T t4ure4n

          Bro. The app I am woking on is a WinForm and not webbased. second I can't c "RowCreated event" in the event list of DataGrid Object.

          o O º(`'·.,(`'·., ?,.·''),.·'')º O o° »·'"`»* *? t4ure4n ?* *«·'"`« °o O º(,.·''(,.·'' ?`'·.,)`'·.,)º O o°

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Sorry, I assumed Web since when not specified that is usually the target here. After the DataGrid has been bound loop through the columns and set the width. And don't use Bro please


          only two letters away from being an asset

          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