Click here to Skip to main content
15,888,246 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more: , +
Hi all,

I have made a new class Enter_DataGridView which inherit from the class DataGridView to override a specific function.

It was really great but when I set the new control modifier it gives me this error :

Inconsistent accessibility: field type 'My_Project.Enter_DataGridView' is less accessible than field 'My_Project.My_Form.dataGridView1'

Please help me as I want to use this control in an external class as a public control (it accepts private modifier only)

Thanks in advance,
:)
Posted

1 solution

If you want to use your Enter_DataGridView in other projects, it should be declared as public.
C#
public class Enter_DataGridView
{
   ...................
}
 
Share this answer
 
Comments
Michael Waguih 16-Mar-11 11:37am    
Thanks a lot it works fine. :)
Sergey Alexandrovich Kryukov 16-Mar-11 21:53pm    
Simple as that, a 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900