Formating text in a datagridview

How do i convert the text of a cell in the datagridview to uppercase before i save it to the database

Answer this question

Formating text in a datagridview

  • Troy Lundin

    That worked great, thanks very much.

    Cheers

  • MeZKaL

    are you using a DataAdapter to update the database

    Generally you would simply get and set the value of the cell and use the ToUpperCase() in the string class to make the text/string uppercase, however this is untested:

    this.theDataGridView.Rows[RowIndex].Cells[CellIndex].Value = this.theDataGridView.Rows[RowIndex].Cells[CellIndex].Value.ToString().ToUpperCase();

     

    does this work



  • Formating text in a datagridview