Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            ThemeResolutionService.ApplyThemeToControlTree(this, THEME);
            ThemeResolutionService.ApplyThemeToControlTree(this.settingsPanel, THEME);

            this.customersTableAdapter.Fill(this.northwindDataSet.Customers);

            // table view
            this.tableView = (TableViewDefinition)this.radGridView1.ViewDefinition;
            InitializeGrid();
            this.radRadioHTML.ToggleState    = Telerik.WinControls.Enumerations.ToggleState.On;
            this.radGridView1.ViewDefinition = htmlView;
        }
Exemplo n.º 2
0
        public RadGridViewCustom()
        {
            foreach (var column in this.Columns)
            {
                column.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            }
            this.Cursor = Cursors.Hand;
            this.Font   = new System.Drawing.Font("IRANYekan", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.MasterTemplate.AllowAddNewRow      = false;
            this.MasterTemplate.AllowColumnReorder  = false;
            this.MasterTemplate.AllowDragToGroup    = false;
            this.MasterTemplate.AllowEditRow        = false;
            this.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;



            //delete btn
            GridViewCommandColumn deleteBtnColumn = new GridViewCommandColumn();

            deleteBtnColumn.AllowHide  = false;
            deleteBtnColumn.HeaderText = "حذف";
            deleteBtnColumn.Image      = Utility.Properties.Resources.Icon_material_delete_forever;
            deleteBtnColumn.MaxWidth   = 50;
            deleteBtnColumn.Name       = "GridDeleteBtn";
            deleteBtnColumn.Width      = 50;

            //edit btn
            GridViewCommandColumn editBtnColumn = new GridViewCommandColumn();

            editBtnColumn.AllowHide  = false;
            editBtnColumn.HeaderText = "ویرایش";
            editBtnColumn.Image      = Utility.Properties.Resources.Icon_feather_edit;
            editBtnColumn.MaxWidth   = 60;
            editBtnColumn.Name       = "GridEditBtn";
            editBtnColumn.Width      = 60;

            //this.MasterTemplate.Columns.AddRange(new GridViewDataColumn[] {
            //editBtnColumn,deleteBtnColumn});

            this.MasterTemplate.EnableGrouping = false;
            TableViewDefinition tableViewDefinition = new TableViewDefinition();

            this.ViewDefinition           = tableViewDefinition;
            this.ReadOnly                 = true;
            this.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.Auto;
            this.ThemeName                = "Material";
            this.SelectionMode            = GridViewSelectionMode.None;
            this.AutoGenerateColumns      = true;
        }