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. datagrid problem?

datagrid problem?

Scheduled Pinned Locked Moved C#
helpquestion
2 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.
  • I Offline
    I Offline
    isarfraz
    wrote on last edited by
    #1

    its very urgent regarding datagrid. i want to put combobox in the datagrid. i have search the web and codeproject but normally these are set with Dock style "Fill" :( but infact i want without of this. I also want to bind datagrid with the Datatable. Is this possible without using the "DatagridTableStyle" class. Kindly friends tell me many ways so that i will select best i want. Thanks and regards Muhammad Sarfraz

    H 1 Reply Last reply
    0
    • I isarfraz

      its very urgent regarding datagrid. i want to put combobox in the datagrid. i have search the web and codeproject but normally these are set with Dock style "Fill" :( but infact i want without of this. I also want to bind datagrid with the Datatable. Is this possible without using the "DatagridTableStyle" class. Kindly friends tell me many ways so that i will select best i want. Thanks and regards Muhammad Sarfraz

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Using a DataGridColumnStyle is the best way to do this. That's what they're there for - to customize the data-bindable cells in a DataGrid. There's an easy article about this in MSDN posted a few months ago at http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx[^]. If you don't want to use this mechanism, then handle the DataGrid.CurrentCellChanged event, determine if you should show a ComboBox for the current cell, then add a ComboBox to the DataGrid's container's Controls collection with a higher TabStop than the DataGrid, and size the ComboBox to match the cell's extents. This is a really poor way of handling this and I'm not guaranteeing that it'll work.

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      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