Urgent ! simple question ! using a DataGridView's protected metho

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there!

I have created a DataGridView in VC++ (in Visual Studio 2005, .NET 2.0), say
its named "myGrid".

I am trying to use its protected method, SetSelectedRowCore, to say
highlight (select) row number 3.

but the compiler says that method can not be accessed.

I know "SetSelectedRowCore" is a protected method for DataGridView. How can
use it ? please help. Thank you very so much !!!

Cheers !
 
Hi gon_nol,

gon_no1 said:
Hi there!

I have created a DataGridView in VC++ (in Visual Studio 2005, .NET 2.0),
say
its named "myGrid".

I am trying to use its protected method, SetSelectedRowCore, to say
highlight (select) row number 3.

but the compiler says that method can not be accessed.

Protected members are only available if you inherit that class. You might
use reflection but than you are ignoring the contract rules of the class.
I know "SetSelectedRowCore" is a protected method for DataGridView. How
can
use it ? please help. Thank you very so much !!!

Use CurrentRow or CurrentCell to select rows or cells.

Bye,
SvenC
 
Back
Top