DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005

    Question Set datagrid column width

    Hi people,

    How do I set a column width of a datagrid programmatically? Here is part of my code how I add a column to my datagrid.

            ' -- add bound columns to datagrid
            Dim col As New BoundColumn
            col = New BoundColumn
            col.HeaderText = "Name"
            col.DataField = Name
            col.SortExpression = Name
    I have set the width = 10px of the datagrid1 in the Design view, but the datagrid change its size if there are too much data in one record. I want a fixed size datagrid and always stay at the size that I have specified all the time no matter how much data are in a row.

    Please help


  2. #2
    Join Date
    Oct 2005
    You can create a table with fix size (using html tag), after that you put your datagrid in to it. Think it will work as u think

  3. #3
    Join Date
    Aug 2005
    I think you have removed the tick on the "wrap content..." indicator in design time. Try to tick it and see whether it could solve the problem.

  4. #4
    Join Date
    Feb 2005
    thanks both,

    I will try your both suggestions in the future. At the mean time, I have remove unneccessary fields to keep the datagrid looks good....


Similar Threads

  1. Getting a GUI to run
    By Eric in forum Java
    Replies: 4
    Last Post: 04-14-2006, 09:09 AM
  2. Truncate DataGrid column?
    By Phil Weber in forum ASP.NET
    Replies: 0
    Last Post: 03-21-2002, 02:47 PM
  3. Getting a GUI to function
    By Eric in forum Java
    Replies: 1
    Last Post: 11-27-2001, 06:53 AM
  4. Create Procedure
    By YC Choo in forum Database
    Replies: 5
    Last Post: 09-03-2001, 01:42 PM
  5. How to set a datacombo in a datagrid
    By Asfar in forum VB Classic
    Replies: 1
    Last Post: 04-25-2001, 01:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.