none
DataGridView Column Name RRS feed

  • Question

  • Good Day!!

    how to change the column name of the datagridview??the column name of my datagridview are the variable names at MySQL Database

    Thanks to all..

    Tuesday, July 21, 2009 3:20 AM

Answers

All replies

  • Try placing this in you Form's Load Event...



    With <The Name of your DGV>.Columns("<The name of your data field>")

    '\\ Header
    .HeaderText = "<The name of your column>"
    .HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter

    '\\ Cells
    .DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
    .AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
    .Resizable = DataGridViewTriState.False

    End With

    Hope it helps,
    Fulano
    • Proposed as answer by LanceDeimont Thursday, July 23, 2009 4:02 PM
    Thursday, July 23, 2009 6:28 AM
  • tHAnks Mr. FUlano
    it works :)
    Thursday, July 23, 2009 9:06 AM