locked
choose data source RRS feed

  • Question

  • how can i  add the option "choose data source" to a smart tag in a custom server control? (like in gridview)
    Make it Ice
    • Edited by Spidey Friday, September 19, 2008 4:52 PM
    Friday, September 19, 2008 4:50 PM

Answers

  • i solved this, After 3 days i found the simplest answer => inherit from CompositeDataBoundControl and add a attribute [DesignerAttribute(typeof(SampleControlDesigner))] that references a class that inherit from DataBoundControlDesigner.

    i know this thread dosnt belong here but i just posting this in case...
    Make it Ice
    Monday, September 22, 2008 6:46 PM

All replies

  • Friday, September 19, 2008 5:15 PM
  • If you need to support Windows Forms Designer smart tags to your control, ask in the Windows Forms Designer forum.
    MSMVP VC++
    Friday, September 19, 2008 5:26 PM
  • i found a way of doing this, i have the dropdown option to "choose new data source" and it list the current datasource in the page, but i dont know where invoke the "data source configuration wizard", i know is invoked with the call to this method "System.Web.UI.Design.WebControls.CreateDataSourceDialog"

    That is my current code:
                [TypeConverter(typeof(ChooseDataSource))]  
                public string Texty  
                {  
                    get;  
                    set;  
                }  
     
                private sealed class ChooseDataSource : DataSourceIDConverter  
                {  
                      
                }  
                public override DesignerActionItemCollection GetSortedActionItems()  
                {  
                    if (items == null)  
                    {  
                        // Create the collection  
                        items = new DesignerActionItemCollection();  
     
                        // Add a header to the list  
                        items.Add(new DesignerActionPropertyItem("Texty""nombrex"));  
                     }  
                 return items  
                } 


    this is for a web server control. i dont see web forms designer forum :/

    Make it Ice
    • Edited by Spidey Friday, September 19, 2008 5:30 PM
    Friday, September 19, 2008 5:26 PM
  • Visual Web Developer questions should be posted on forums.asp.net or another web programming community.  

    MSMVP VC++
    Friday, September 19, 2008 5:36 PM
  • i solved this, After 3 days i found the simplest answer => inherit from CompositeDataBoundControl and add a attribute [DesignerAttribute(typeof(SampleControlDesigner))] that references a class that inherit from DataBoundControlDesigner.

    i know this thread dosnt belong here but i just posting this in case...
    Make it Ice
    Monday, September 22, 2008 6:46 PM