C#C
C#3y ago
chichak

❔ ASP.NET, C#, Composite Server Control

Hi,
i start with development of my custom GridView control with implementation all features that i made in my module (DNN) but now i am stacked with properties.

I define Property Columns and DataControlFieldCollectionEditorForm and in Design Mode i can finnaly opet editor and add for example BoundField, but when I close Dialog, code with new Columns are not refreshed and after reloading .aspx file Columns are not exists.

I buy books Advanced Asp.Net Ajax Server Controls, ASP.NET 4.5 in C#, .... but there is only 1 or 2 chapters where i cannot find something about that, also search on google but without success.

here is parts of my code, so if anybody have wish i will be grateful to him.


namespace ServerControls
{
[
AspNetHostingPermission(SecurityAction.Demand,
Level = AspNetHostingPermissionLevel.Minimal),
AspNetHostingPermission(SecurityAction.InheritanceDemand,
Level = AspNetHostingPermissionLevel.Minimal),
ToolboxData("<{0}:myGridView runat=server></{0}:myGridView>")
]
//[ParseChildren(true)]
//[PersistChildren(false)]
[Designer(typeof(myGridViewDesigner))]
public class myGridView : CompositeControl
{
[
Category("myGrid"),
DefaultValue((string)null),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Editor(typeof(myGridDataControlFieldCollectionEditorForm), typeof(UITypeEditor)), // Custom defined in file myGridDataControlFieldCollectionEditorForm.cs
PersistenceMode(PersistenceMode.InnerProperty)
]

public DataControlFieldCollection Columns { get { EnsureChildControls(); return gridView.Columns; } }

........ code .....

protected override void CreateChildControls()
{
EnsureChildControls();
...... rest of code
}
......... code .....
}
Screenshot_2023-10-29_083951.png
Was this page helpful?