|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CompositeControl with GridView and Columns propertyto 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), _ Editor(GetType(System.Web.UI.Design.WebControls.DataControlFieldTypeEditor), GetType(UITypeEditor)), _ MergableProperty(False), _ DefaultValue(CStr(Nothing)), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property Columns() As DataControlFieldCollection Get Me.EnsureChildControls() 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 DataBoundControl: Public Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As Object) As Object Dim control1 As DataBoundControl = TryCast(context.Instance,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?
Other interesting topics
Conditional True/False output for datalist item
error: can't find control 'mylabel' which expert can finally solve this? WSS document event handler that will use System.web.mail sendmail Disappearing Web Part Trick Center Login Control and Firefox Admin front end generator How to access a server control within a repeater control Using Control.Render() from a page with a MasterPage Dropdownlist SelectedIndexChanged does not fire? |
|||||||||||||||||||||||