DataBoundControl Designer

M

maxcocco

Hello,
I'm writing my own custom DataBound control, inherited from
DataBoundControl, and I'd like to build the associated custom Designer.

Basically, what i want to do is add a SmartTag to the existing
DataBoundControl designer, but I can't seem to figure out how to do it.

Based on the info I found out, I wrote this code:

public class igcGridViewDesigner:DataBoundControlDesigner
{

public igcGridViewDesigner():base()
{

}

private DesignerActionListCollection _actionLists;
public override DesignerActionListCollection ActionLists
{
get
{
if (_actionLists==null)
{
_actionLists=new DesignerActionListCollection();
_actionLists.Add(new
igcDataGridAutoGenerateColumnAction(this.Component));
}
return _actionLists;
}
}

}

public class igcDataGridAutoGenerateColumnAction :
System.ComponentModel.Design.DesignerActionList
{
private igcDataGrid _myGrid;

public igcDataGridAutoGenerateColumnAction( IComponent
component ) : base(component)
{
this._myGrid = component as igcDataGrid;
}

private void RefreshColumnSchema()
{
_myGrid.GenerateColumns();
}

public override DesignerActionItemCollection
GetSortedActionItems()
{
DesignerActionItemCollection items = new
DesignerActionItemCollection();

items.Add(new DesignerActionMethodItem(this,
"RefreshColumnSchema", "Generate
Columns",
"Appearance",
"Generate Columns.",
true));
return items;
}
}

With this code, the "RefreshColumnSchema" Tag get rendered on the
designer, but the designer itself loses its functionality.

Can someone tell me the right way to do this?

Tanx,
Max
 

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

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top