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. Web Development
  3. ASP.NET
  4. datagrid size

datagrid size

Scheduled Pinned Locked Moved ASP.NET
helpdesignquestion
3 Posts 3 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.
  • X Offline
    X Offline
    x trate
    wrote on last edited by
    #1

    Hi! I have an aparent simple problem, but i need some help, please! i have a datagrid. The column are created in code, and not with property builder. I want to change de datagrid' size (and, if possible, the size of every column), so that it can integrate with my design page. In property builder i didn't find anything, and in msdn i found something with an Size object, but...no result. Please, can you give me some directions? Thank you!

    H J 2 Replies Last reply
    0
    • X x trate

      Hi! I have an aparent simple problem, but i need some help, please! i have a datagrid. The column are created in code, and not with property builder. I want to change de datagrid' size (and, if possible, the size of every column), so that it can integrate with my design page. In property builder i didn't find anything, and in msdn i found something with an Size object, but...no result. Please, can you give me some directions? Thank you!

      H Offline
      H Offline
      hakanaktan
      wrote on last edited by
      #2

      While creating your dynamic bound columns on page you can give them their sizes.In this code i gave the same size to all my dynamic columns in a "for next" circle. Private Sub myDataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles myDataGrid.ItemCreated For ColumnCounter As Integer = 0 To e.Item.Cells.Count - 1 Dim virtualTextBox As TextBox = CType(e.Item.Cells(ColumnCounter).Controls(0), TextBox) virtualtextBox.Width = Unit.Pixel(70) Next End Sub --junior coder--

      1 Reply Last reply
      0
      • X x trate

        Hi! I have an aparent simple problem, but i need some help, please! i have a datagrid. The column are created in code, and not with property builder. I want to change de datagrid' size (and, if possible, the size of every column), so that it can integrate with my design page. In property builder i didn't find anything, and in msdn i found something with an Size object, but...no result. Please, can you give me some directions? Thank you!

        J Offline
        J Offline
        jinnyb
        wrote on last edited by
        #3

        Hey as far as i know u can with the help of datagrid.columns[indexof the column you want to resize].itemstyle.width. Hope this shall help u Have a great week and the end is not too far Regards JINNY Patel Neelesh A

        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