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 igcGridViewDesignerataBoundControlDesigner
{
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
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 igcGridViewDesignerataBoundControlDesigner
{
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