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
 

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