Is there a way to access control properties within custom user control from Designer using c# (Windows Forms)

Djordje

I have here some custom user control with DataGridView in it, now when i Implement my user control to some form I want to be able to access DataGridView properties within designer, is this possible?

This is my user control

   public partial class MyUserControlTest01 : UserControl
    {

        // my way to accsses DataGridView 
        // 
        public DataGridView Dtv_userControl
        {
            get { return myUserControl_datagridView; }
            set { myUserControl_datagridView = value; }
        }


        public MyUserControlTest01()
        {
            InitializeComponent();

        }

So when i implement this user control to some Form, I can access DataGridView properties from code, but i want to do it from Designer.

Hope my question is clear, any suggestion is helpful.

Thank you for your time.

Pulle

Just add these annotations over your DataGridView-Property

[Browsable(true)]
[Category("*Any category you want*")]
public DataGridView Dtv_userControl
{
   get { return myUserControl_datagridView; }
   set { myUserControl_datagridView = value; }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to add Custom Properties to WPF User Control

C# Custom Control Properties

Is there a way to not auto-generate the click event logic when a control is double-clicked in the Windows Forms designer?

Recommended way to manipulate User Control panels into a Windows From

Picker within Custom Control

Designer error when redirecting a button click within a custom user control

Get the property value set in the Designer from another property of a Custom Control

Access controls not properties in XAML User Control

Reorder / move / dragdrop ListViewItems within the same ListView Control in C# Windows Forms

Access a RichTextBox Control properties from within DataGridView Cell

How to bind or get properties from User Control

WPF control derived from Label: are custom properties (with DP) not using the setter?

Properties changing in a custom control

Windows Forms custom control painting stops

How to show a custom user control from a Class Library in C#

Modify c# Windows Forms control library

Adding a custom control to the designer

Control dynamic Custom Control Properties from code-behind

Unable to access user control public properties from generic handler

Creating Windows Forms labels within a tab control C#

Create a property of custom user control using c# Winforms

c# winform : override default properties in designer from custom control

How to access property defined in code-behind from markup in Web Forms User Control

Access user control name in MainWindow from within user control

c# lock a windows forms control

Xamarin Forms Custom Control and Bindable properties not working as expected

Xamarin Forms - Check from Custom Renderer if control has properties set from XAML

Custom Properties Picturebox control

What is the best way to access fromControl within a custom form control