0

I'm creating a specific DataGridView control that includes two scrollbars so that I can control their size and visibility. So, I have created a User control that contains the DataGridView and the two scrollbars inside a 2x2 TableLayoutPanel.

The issue I'm facing is that when I add my control to a Windows Form, I can't set my DataGridView's DataSource or define the column styles from the design view, because the link that I use for that when I use a common DataGridView (that little white arrow appearing on the top right side of the DataGridView) is not appearing.

While doing some testing, I saw that if I inherit my control from DataGridView, that link appears. But if I do that, I guess that I can only extend the functionality for the DataGridView, but I need my control to be a composite control.

So, that's my question: how can I get those design-time capabilities on my custom control? I am specially interested on the columns layout and the datasource.

Best regards.

1 Answers1

0

If you are doing a usercontrol (a control that has an .ascx codebehind file) there seems to be no way to control this: How to hide the inner controls of a UserControl in the Designer?

If you are doing a WebControl (a class that inehrits from WebControl with no .ascx file) you may create your own designer and maybe somehow output the designers of both conrols. Have a look at: http://msdn.microsoft.com/en-us/library/12yydcke.aspx it explains how to create a webcontrol and its desgner.

Some things with usercontrols/webcontrols seem to be easy but are hard to implement...

Hope this helps!

Community
  • 1
  • 1
mortb
  • 9,361
  • 3
  • 26
  • 44