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 add control in datagridview column..

How to add control in datagridview column..

Scheduled Pinned Locked Moved C#
databasetutorial
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.
  • R Offline
    R Offline
    Rahul83
    wrote on last edited by
    #1

    hi friends.. I want to rtrive some imformation from database(say comments,which is somewhere around four to five lines)and bind the same to datagridview column..for that i need add a textbox which has a scroll property to datagrid column..can you plz tell me how to do this.. regards, Rahul

    M 1 Reply Last reply
    0
    • R Rahul83

      hi friends.. I want to rtrive some imformation from database(say comments,which is somewhere around four to five lines)and bind the same to datagridview column..for that i need add a textbox which has a scroll property to datagrid column..can you plz tell me how to do this.. regards, Rahul

      M Offline
      M Offline
      Manoj Kumar Rai
      wrote on last edited by
      #2

      Hi, Use the following steps to get the scroll bars and multiline drawn: 1) Implement the "EditingControlShowing" event handler of the datagrid. 2) Check if the currently editable control is of type "TextBoxEditingControl" . 3) Finally set the properties. The block of the code need to add in the "EditingControlShowing" event handler is as below: if (e.Control.GetType() == typeof(DataGridViewTextBoxEditingControl)) { DataGridViewTextBoxEditingControl EditingControl = (DataGridViewTextBoxEditingControl)e.Control; EditingControl .ScrollBars = ScrollBars.Both; EditingControl .Multiline = true; }

      Manoj Never Gives up

      R 1 Reply Last reply
      0
      • M Manoj Kumar Rai

        Hi, Use the following steps to get the scroll bars and multiline drawn: 1) Implement the "EditingControlShowing" event handler of the datagrid. 2) Check if the currently editable control is of type "TextBoxEditingControl" . 3) Finally set the properties. The block of the code need to add in the "EditingControlShowing" event handler is as below: if (e.Control.GetType() == typeof(DataGridViewTextBoxEditingControl)) { DataGridViewTextBoxEditingControl EditingControl = (DataGridViewTextBoxEditingControl)e.Control; EditingControl .ScrollBars = ScrollBars.Both; EditingControl .Multiline = true; }

        Manoj Never Gives up

        R Offline
        R Offline
        Rahul83
        wrote on last edited by
        #3

        Thanks a Lot Manoj..I dont know how people like u know each and every thing.. out of curiosity I will like to know since from how long u r working on dot net

        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