Current column from derived style.

G

Guest

I have a class that derives from DataGridTextBoxColumn like:

Public Class DataGridEditTextBoxColumn
Inherits DataGridTextBoxColumn

In this class I override Edit

Protected Overloads Overrides Sub Edit(ByVal source As
CurrencyManager, ByVal rowNum As Integer, ByVal bounds As Rectangle, ByVal
[readOnly] As Boolean, ByVal instantText As String, ByVal cellIsVisible As
Boolean)
MyBase.Edit(source, rowNum, bounds, False, instantText,
cellIsVisible)
Dim _col As Integer
End Sub

From the passed arguments how do I tell which column is being edited?

Thank you.

Kevin
 
C

Claes Bergefall

Well, the MappingName should tell you which column it is. Or you use the
DataGridTableStyle property and loop it's GridColumnStyles collection until
you find yourself.

What do you need it for?

/claes
 
G

Guest

I will see if I can use that information. Thank you for the suggestion. I
need to know the column number so I know which column has been changed. I
know the row number by overriding the Edit method and it is passed in. I just
need to know the column number as well.

Thanks again.

Kevin

Claes Bergefall said:
Well, the MappingName should tell you which column it is. Or you use the
DataGridTableStyle property and loop it's GridColumnStyles collection until
you find yourself.

What do you need it for?

/claes

Kevin Burton said:
I have a class that derives from DataGridTextBoxColumn like:

Public Class DataGridEditTextBoxColumn
Inherits DataGridTextBoxColumn

In this class I override Edit

Protected Overloads Overrides Sub Edit(ByVal source As
CurrencyManager, ByVal rowNum As Integer, ByVal bounds As Rectangle, ByVal
[readOnly] As Boolean, ByVal instantText As String, ByVal cellIsVisible As
Boolean)
MyBase.Edit(source, rowNum, bounds, False, instantText,
cellIsVisible)
Dim _col As Integer
End Sub

From the passed arguments how do I tell which column is being edited?

Thank you.

Kevin
 

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

Top