Setting DataGridView cell contents to uppercase

Posted on 2006-05-20
Last Modified: 2012-06-27


A simple thing....I thought.

In a new row for data in datagridview, change the data entered by the user to uppercase.  

Any ideas?

I have tried:

Intercepting the e.proposedvalue property and changing it there... no joy
Intercepting the cellleave event and changing joy
I am looking at intercepting it in the stored proc in the SQL database, but there must be a way to accomplish this simply in the front end.


Question by:alan_ITG

    Author Comment



    I have solved this by using Stored Procedures as the method for managing the TableAdapter/Db relationships and then amending the stored procedure to use UPPER() on the relevant values.  The result of this is that the data in the DataGriedView remains in the case submitted by the user until a save operation takes place, when it is returned as uppercase.

    I would still like to manage this in the DataGridView (DGV) and am looking at the formatting options available and original/proposed values for the DGV to see if this is where I should make the required changes.

    Still, any insight would be useful.


    LVL 28

    Accepted Solution

    will it work for you

    dgv.CurrentCell = dgv(iCol, iRow)
    dim s as string = dgv.CurrentCell.Value.ToUpper
     dataGridView.Rows(iCol).Cells(IRow).Value = s

    Author Comment



    thanks for your help!



    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video discusses moving either the default database or any database to a new volume.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now