DataBoundControl Designer

Discussion in 'ASP .Net Web Controls' started by maxcocco, Jul 14, 2006.

  1. maxcocco

    maxcocco Guest

    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
    maxcocco, Jul 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmFmZmE=?=

    Custom WebControl using DataBoundControl and Templates

    =?Utf-8?B?SmFmZmE=?=, Dec 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    782
    =?Utf-8?B?SmFmZmE=?=
    Dec 7, 2005
  2. Shimon Sim
    Replies:
    0
    Views:
    338
    Shimon Sim
    Jun 11, 2006
  3. sloan
    Replies:
    1
    Views:
    306
    Masudur
    Jan 25, 2007
  4. Sebastian Paul
    Replies:
    0
    Views:
    341
    Sebastian Paul
    Aug 21, 2007
  5. sloan
    Replies:
    2
    Views:
    116
    sloan
    Jan 25, 2007
Loading...

Share This Page