Setting DataGridView cell contents to uppercase


Hi,

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 there...no 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.

Regards,


Alan
alan_ITGAsked:
Who is Participating?
 
iboutchkineCommented:
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
0
 
alan_ITGAuthor Commented:

Hi,

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.

Regards,


Alan
0
 
alan_ITGAuthor Commented:

iBoutchkine,

thanks for your help!

Regards,

Alan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.