RadGrid subclass cannot be added to Toolbox

2 posts, 0 answers
  1. Martin
    Martin avatar
    7 posts
    Member since:
    Dec 2007

    Posted 12 Feb 2008 Link to this post

    I'd like to subclass RadGrid prometheus in one of our assemblies so that the grid properties are set uniformly for each client developer like so:
    namespace MP.Core.Controls
    {
        public class MPViewGrid : Telerik.Web.UI.RadGrid
        {
            MPViewGrid()
            {
                FormatControls();
            }
            private void FormatControls()
            {
                this.AllowPaging = true;
                this.AllowSorting = true;
                this.GridLines = GridLines.Horizontal;
                this.ShowGroupPanel = true;
           }
        }
    }
    It compiles just fine, but I cannot get the derived grid, MPViewGrid, to show up in the developer's toolbox.  What should I do to make this happen?

    Thank you,
    Martin.


  2. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 13 Feb 2008 Link to this post

    hi


    By default, the visual designer, of a tool such as Visual.Studio, creates an empty tag. This is a tag representing a control in its default state, when the control is dropped from the toolbox of a visual designer onto the design surface. To specify initial default values, a control can make use of this attribute. You can use this attribute to customize the initial HTML content that is placed in the designer when the control is dragged from the toolbox onto the form.

    Here is an example:

    using System;  
    using System.Web;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
     
     
    namespace CustomControls  
    {  
     
      [ ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta' BorderWidth = '10'  runat='server'></{0}:MyLabel>") ]      
      public class MyLabel : Label   
      {  
        public  MyLabel()  
        {   
          // Your code goes here.  
        }   
      }  
     
    }  
     


    Regards...
    <John:Peel />
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top