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. How to Insert User Control into DataGrid Cell ?

How to Insert User Control into DataGrid Cell ?

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelptutorialquestion
3 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.
  • A Offline
    A Offline
    ArunkumarSundaravelu
    wrote on last edited by
    #1

    Hi How to insert string value and Button in Datagridview cell. Like properties window in visual studio 2005. In our project, their is a module which shows same like Properties windows in visualstudio 2005. so that we use datagridview and using DataGridViewComboBoxCell to insert combo box in some particular cell. our problem is suppose if we insert a filename, so that we need textbox and same with small button which will used to browse the file. so that how to insert usercontrol or textbox with button in datagridview cell?

    H 1 Reply Last reply
    0
    • A ArunkumarSundaravelu

      Hi How to insert string value and Button in Datagridview cell. Like properties window in visual studio 2005. In our project, their is a module which shows same like Properties windows in visualstudio 2005. so that we use datagridview and using DataGridViewComboBoxCell to insert combo box in some particular cell. our problem is suppose if we insert a filename, so that we need textbox and same with small button which will used to browse the file. so that how to insert usercontrol or textbox with button in datagridview cell?

      H Offline
      H Offline
      Hessam Jalali
      wrote on last edited by
      #2

      i didn't work a lot With DataGridView, adding userControl to DataGridView can be done but in the cell I don't know you can inherit from DataGridViewTextBoxCell class and override the Paint method for resizing the TextBox (i said form TextBoxCell because creating a TextBox is far more harder than a Button) and for drawing a button beside the textBox. I know this is a tedious solution but it would work!

      A 1 Reply Last reply
      0
      • H Hessam Jalali

        i didn't work a lot With DataGridView, adding userControl to DataGridView can be done but in the cell I don't know you can inherit from DataGridViewTextBoxCell class and override the Paint method for resizing the TextBox (i said form TextBoxCell because creating a TextBox is far more harder than a Button) and for drawing a button beside the textBox. I know this is a tedious solution but it would work!

        A Offline
        A Offline
        ArunkumarSundaravelu
        wrote on last edited by
        #3

        Thanks Hessam Jalali, yet to try this, can you explain little bit briefly.

        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