CompositeControl with GridView and Columns property

Discussion in 'ASP .Net Web Controls' started by danieljroot, Aug 21, 2006.

  1. danieljroot

    danieljroot Guest

    I'm writing a CompositeControl that includes a child GridView. I want
    to expose the GridView's Columns property at design time and allow the
    developer to customize the columns, but don't want them to set the
    DataSourceID, etc. So, I did this on my control:

    <PersistenceMode(PersistenceMode.InnerProperty), _

    GetType(UITypeEditor)), _
    MergableProperty(False), _
    DefaultValue(CStr(Nothing)), _

    Public ReadOnly Property Columns() As
    Return memberGridView.Columns
    End Get
    End Property

    However, the DataControlFieldTypeEditor does not appear when the [...]
    button is clicked in the property grid. No UI or error occurs at all.
    Using Reflector, I suspect that this is because the control is not a

    Public Overrides Function EditValue(ByVal context As
    ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value
    As Object) As Object
    Dim control1 As DataBoundControl =
    If (control1 Is Nothing) Then
    Return Nothing
    End If

    But I'm stuck there. So, my question is: How can I expose a Columns
    property and get the design-time behavior identical to the GridView?
    danieljroot, Aug 21, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.