Uppercase

  • Thread starter Thread starter Randy Fraser
  • Start date Start date
R

Randy Fraser

Could someone tell me how I can force uppercase characters in a TextBox
column in a datagrid?


Thanks

Randy
 
Hi,

Create a new datagridtextboxcolumn for that.



Public Class UpperCaseColumn

Inherits DataGridTextBoxColumn







Protected Overloads Overrides Sub Edit(ByVal source As
System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal
bounds As System.Drawing.Rectangle, ByVal [readOnly] As Boolean, ByVal
instantText As String, ByVal cellIsVisible As Boolean)

MyBase.Edit(source, rowNum, bounds, [readOnly], instantText,
cellIsVisible)

MyBase.TextBox.CharacterCasing = CharacterCasing.Upper

End Sub





Protected Overrides Function GetColumnValueAtRow(ByVal source As
System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer) As Object

Dim obj As Object

obj = MyBase.GetColumnValueAtRow(source, rowNum)

Return obj.ToString.ToUpper

End Function

End Class



Ken

-------------------------



_____

From: Randy Fraser [mailto:[email protected]]
Sent: Tuesday, June 22, 2004 4:05 PM
To: microsoft.public.dotnet.languages.vb
Subject: Uppercase



Could someone tell me how I can force uppercase characters in a TextBox
column in a datagrid?


Thanks

Randy
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top