set the width of dataGrid column

Discussion in 'ASP .Net' started by Joko suprianto, Mar 13, 2005.

  1. Hi, i want to ask how to set the width of each of the
    column on the datagrid. im using vb.net
    because from what i know in vb.net we have
    DataGrid1.TableStyles(0).GridColumnStyles(2).width = 150
    that can set the width in datagrid column, but i couldnt
    use this method in asp.net

    thax
     
    Joko suprianto, Mar 13, 2005
    #1
    1. Advertisements

  2. You can set the width of each column in the Property Builder of the datagrid
    Define the columns you want in the Columnstab
    set the width in the Formattab
     
    Nicole Legroe, Mar 13, 2005
    #2
    1. Advertisements

  3. Joko suprianto

    Joko Guest

    But i want to set it dynamically, do you know how to do
    it?
     
    Joko, Mar 13, 2005
    #3
  4. Joko suprianto

    Maarten Guest

    Maarten, Dec 8, 2005
    #4
  5. Joko suprianto

    Maarten Guest

    Maarten, Dec 8, 2005
    #5
  6. Joko suprianto

    Maarten Guest

    Maarten, Dec 8, 2005
    #6
  7. Joko suprianto

    smanipasu

    Joined:
    Jan 21, 2009
    Messages:
    1
    Likes Received:
    0
    Try this

    hi,

    try this line at the end of the grid data mapping

    DataGridView1.AutoResizeColumns();

    [email protected]!.
     
    smanipasu, Jan 21, 2009
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.