Results 1 to 3 of 3

Thread: VS[2005] Win CE 5.0 Resize Datagrid Column

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    VS[2005] Win CE 5.0 Resize Datagrid Column

    Using a datatable bound to my datagrid I am wondering how to resize the datagrid's columns.
    This is the code I am using:

    vb Code:
    1. Private Sub frmMovement_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         CreateDT()
    3.         DataGrid1.DataSource = ds.Tables("Movements")
    4.  
    5.         txtFrom.Focus()
    6.  
    7.  
    8.  
    9.  
    10.     End Sub
    11.    Private Sub CreateDT()
    12.  
    13.         dtMovements = New DataTable("Movements")
    14.  
    15.  
    16.         'creates Seq column in datatable
    17.         Dim cSeq As DataColumn = New DataColumn("Seq")
    18.         cSeq.DataType = Type.GetType("System.Int16")
    19.  
    20.         dtMovements.Columns.Add(cSeq)
    21.  
    22.         'creates From column in datatable
    23.         Dim cFrom As DataColumn = New DataColumn("From")
    24.         cFrom.DataType = Type.GetType("System.String")
    25.  
    26.         dtMovements.Columns.Add(cFrom)
    27.  
    28.         'creates Scancode column in datatable
    29.         Dim cScanCode As DataColumn = New DataColumn("ScanCode")
    30.         cScanCode.DataType = Type.GetType("System.String")
    31.         dtMovements.Columns.Add(cScanCode)
    32.  
    33.         'creates To column in datatable
    34.         Dim cTo As DataColumn = New DataColumn("To")
    35.         cTo.DataType = Type.GetType("System.String")
    36.         dtMovements.Columns.Add(cTo)
    37.  
    38.         'creates Boxes column in datatable
    39.         Dim cBoxes As DataColumn = New DataColumn("Boxes")
    40.         cBoxes.DataType = Type.GetType("System.Int16")
    41.         dtMovements.Columns.Add(cBoxes)
    42.  
    43.  
    44.         ds.Tables.Add(dtMovements)
    45.  
    46.     End Sub

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: VS[2005] Win CE 5.0 Resize Datagrid Column

    I thought it was possible using the ColumnStyle class, but as far as I can tell, it isn't an option.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: VS[2005] Win CE 5.0 Resize Datagrid Column

    Hi,

    there is a log posting from the .Net CF team here describing the 'new' functionality of the datagrid, plus a sample - this may help



    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

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