This is a migrated thread and some comments may be shown as answers.

CSS in custom control

0 Answers 95 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
nicolas98000
Top achievements
Rank 1
nicolas98000 asked on 12 Jan 2009, 09:54 AM
Hi,

I've created a panelbar (to populate my panel with an ADAM Autority) with custom code (see below) to obtain my own control .
All works well expect skin/css. after compiled i've a custom control(.dll file) wich I can  install in my own toobar. I drag'n drop my control from toolbox, and i obtain a panel bar with my params and the style is with 'bubbles' like winword bullets format .... and no css can be removed this.

somebody can help me ?

thanks

---

 

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.UI;
using my.Common;
using my.Common.Securities;

namespace my.Common.AjaxComponents
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:myPanelBarMenu runat=server></{0}:myPanelBarMenu>")]
    public class myPanelBarMenu : Telerik.Web.UI.RadPanelBar
    {
        private string panelDataTextField;
        private string panelDataFieldID;
        private string panelDataFieldParentID;
        private string panelDataNavigateURL;
        private int panelRowSecurityLevel;
        private string panelAzManConnectionStringName;
        private string panelAzManApplicationStringName;
       

        private int panelRowText;
        private int panelRowID;
        private int panelRowParentID;

       
        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the text that will display by the control")]
        public string myDataTextField
        {
            get
            {
                return panelDataTextField;
            }
            set
            {
                panelDataTextField = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the name of the Azman Application stored in web.config file section <appSettings> . If unspecfified key='myAzManServerCS'")]
        public string myAzManConnectionStringName
        {
            get
            {
                return panelAzManConnectionStringName;
            }
            set
            {
                panelAzManConnectionStringName= value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the name  of the Azman Application. This parameter is required")]
        public string myAzManApplicationStringName
        {
            get
            {
                return panelAzManApplicationStringName;
            }
            set
            {
                panelAzManApplicationStringName= value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the column ID of the Row that contains SecurityLevel stored in Database")]
        public int myRowSecurityLevel
        {
            get
            {
                return panelRowSecurityLevel;
            }
            set
            {
                panelRowSecurityLevel = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the column ID of the Row that contains Text stored in Database")]
        public int myRowText
        {
            get
            {
                return panelRowText;
            }
            set
            {
                panelRowText = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the column ID of the Row that contains ID stored in Database")]
        public int myRowID
        {
            get
            {
                return panelRowID;
            }
            set
            {
                panelRowID = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the column ID of the Row that contains ParentID stored in Database")]
        public int myRowParentID
        {
            get
            {
                return panelRowParentID;
            }
            set
            {
                panelRowParentID = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the column ID of the Row that contains navigateURL stored in Database")]
        public string myDataNavigateURL
        {
            get
            {
                return panelDataNavigateURL;
            }
            set
            {
                panelDataNavigateURL = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the ID that will be used to populate root within hierachical PanelBar the control")]
        public string myDataFieldID
        {
            get
            {
                return panelDataFieldID;
            }
            set
            {
                panelDataFieldID = value;
            }
        }

        [Bindable(true)]
        [Category("my")]
        [DefaultValue("")]
        [Localizable(true)]
        [Description("Specifies the ParentID that will be used to populate all sub-level within hierachical PanelBar the control")]
        public string myDataFieldParentID
        {
            get
            {
                return panelDataFieldParentID;
            }
            set
            {
                panelDataFieldParentID = value;
            }
        }
       
        protected override void OnPreRender(EventArgs e)
        {
            base.RegisterScriptControl();
            GetMenus _menu = new GetMenus();
            DataTable dt = _menu.GetAllItemsMenus().Tables[0];
            Security.AzManAuthenticationMethod Auth_method = new Security.AzManAuthenticationMethod();
            Security.AzManAuthenticationMethod.AzManConnectionStringName = this.panelAzManConnectionStringName;
            string _AzManConnection = Security.AzManAuthenticationMethod.GetAzManConnectionStringName();
            string _AzManApplication = Security.AzManAuthenticationMethod.GetAzmanApplicationStringName();
            try
            {
                Auth_method.LoadApp(_AzManConnection, _AzManApplication);
                Auth_method.LoadCtx();
            }
            catch (System.Runtime.InteropServices.COMException x)
            {
                throw new Security.AzManAuthenticationMethod.AzMethodException(x, "IAzClientContext.AccessCheck");
            }
            SimpleMenu _myMenu = new SimpleMenu();
            foreach (DataRow row in dt.Rows)
            {
                _myMenu.Add(new MenuItem(row[myRowSecurityLevel].ToString(), row[myRowText].ToString(), row[myRowID].ToString(), row[myRowParentID].ToString(),row[myDataNavigateURL].ToString()));
            }
            ArrayList al_GetAutorizedOperationsAZMAN = new ArrayList();
            foreach (Security.AzManAuthenticationMethod.AccessCheckResult op_ok in Auth_method.AccessAll())
            {
                if (op_ok.result == 0)
                {
                    al_GetAutorizedOperationsAZMAN.Add(op_ok.id.ToString());
                }
            }
            DataSet aSet = new DataSet();
            DataTable aTable = new DataTable();
            aSet.Tables.Add(aTable);
            aSet.Tables[0].Columns.Add("Text", typeof(String));
            aSet.Tables[0].Columns.Add("Security_Level", typeof(String));
            aSet.Tables[0].Columns.Add("ID", typeof(String));
            aSet.Tables[0].Columns.Add("Parent_ID", typeof(String));
            aSet.Tables[0].Columns.Add("Navigate_url", typeof(String));
            if (_myMenu.Count != 0)
            {
                foreach (object co in al_GetAutorizedOperationsAZMAN)
                {
                    if (_myMenu.Contains(co.ToString()))
                    {
                        DataRow aRow = aSet.Tables[0].NewRow();
                        aRow[0] = _myMenu[co.ToString()].Text;
                        aRow[1] = _myMenu[co.ToString()].Security_Level;
                        aRow[2] = _myMenu[co.ToString()].ID;
                        if (_myMenu[co.ToString()].Parent_ID == "")
                        {
                            _myMenu[co.ToString()].Parent_ID = null;
                        }
                        aRow[3] = _myMenu[co.ToString()].Parent_ID;
                        aRow[4] = _myMenu[co.ToString()].Navigate_url;
                        aSet.Tables[0].Rows.Add(aRow);
                    }
                }
               

                this.DataTextField = this.myDataTextField; ;
                this.DataFieldID = this.myDataFieldID;
                this.DataFieldParentID = this.myDataFieldParentID;
                this.DataNavigateUrlField = this.myDataNavigateURL;
                                this.DataSource = aSet;
                this.DataBind();

            }
          
        }
    }
      
}

 

 

 

 

No answers yet. Maybe you can help?

Tags
PanelBar
Asked by
nicolas98000
Top achievements
Rank 1
Share this question
or