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. Problem in DataGrid Control

Problem in DataGrid Control

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

    I have written following code, in that i have attached Array to datagrid control, It is working fine. But now I want the column size to be fixed. & I am not able to do it programatically. Any one know that how to do ? TwoDimItem [] stuff1 = new TwoDimItem[5]; stuff1[0] = new TwoDimItem("10 : 11" , "75", "99", "26"); stuff1[1] = new TwoDimItem("10 : 12", "76", "95", "17"); stuff1[2] = new TwoDimItem("10 : 13", "60", "94", "28"); stuff1[3] = new TwoDimItem("10 : 14", "76", "95", "29"); stuff1[4] = new TwoDimItem("10 : 15", "85", "96", "24"); dataGrid1.DataSource = stuff1;

    thanks

    M 1 Reply Last reply
    0
    • S saksp

      I have written following code, in that i have attached Array to datagrid control, It is working fine. But now I want the column size to be fixed. & I am not able to do it programatically. Any one know that how to do ? TwoDimItem [] stuff1 = new TwoDimItem[5]; stuff1[0] = new TwoDimItem("10 : 11" , "75", "99", "26"); stuff1[1] = new TwoDimItem("10 : 12", "76", "95", "17"); stuff1[2] = new TwoDimItem("10 : 13", "60", "94", "28"); stuff1[3] = new TwoDimItem("10 : 14", "76", "95", "29"); stuff1[4] = new TwoDimItem("10 : 15", "85", "96", "24"); dataGrid1.DataSource = stuff1;

      thanks

      M Offline
      M Offline
      Michael Bookatz
      wrote on last edited by
      #2

      Instead of automatically generating the columns you need to specify them and then can specify the column size.

      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