CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    6

    Question Columns in Datagrid

    How can I change width of columns in Datagrid?

    ( System.Windows.Forms.DataGrid)

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    on datagrid properties
    click TableStyles or access it via in code.
    its a collection.
    select the DataGridTableStyle object and then
    goto
    DataGridColumnStyle which is again collection
    via this you could change the width. and

    it will reflect the output.

    prefferedrowwidth is to change the row width.

    this.objTableStylegrdEmpmasterEmpmaster.PreferredColumnWidth = 200;

    this.objTableStylegrdEmpmasterEmpmaster.PreferredRowHeight = 60;

    hope it helps
    -Paresh

  3. #3
    Join Date
    Dec 2002
    Posts
    6
    Thanks, Paresh.

    I had trouble with that because I forgot set "Mapping Name"

    It's strange but I can't set Width to 100 pt per column!?
    Bigger or smaller values works.

    Gnacz.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured