Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: RonaldBiemansPosted on 2004-08-18 at 08:11:39ID: 11831350
create your datagridtextbox class something like
essEventHa ndler(Addr essOf HandleKeyPress)
extBoxColu mn sID) ts1)
Option Strict Off
Option Explicit On
Imports Microsoft.VisualBasic
Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
Namespace DataGridYNOnly
Public Class DataGridYNTextBoxColumn
Inherits DataGridTextBoxColumn
'Fields
'Constructors
'Events
'Methods
Public Sub New()
MyBase.New()
AddHandler Me.TextBox.KeyPress, New System.Windows.Forms.KeyPr
End Sub
Private Sub HandleKeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs)
Me.TextBox.BackColor = Color.Red
End Sub
End Class
End Namespace
call like
Dim ts1 As DataGridTableStyle
ts1 = New DataGridTableStyle
ts1.MappingName = "yourtable"
Dim csID As New DataGridYNOnly.DataGridYNT
csID.MappingName = "yourcolumn"
csID.HeaderText = "yourtext"
csID.Width = 60
ts1.GridColumnStyles.Add(c
DataGrid1.TableStyles.Add(