DevExpress中GridControl中添加編輯按鈕行

DevExpress中GridControl中添加編輯按鈕行

以下爲內容以圖片居多1234表示點擊順序

先新增一行 操作和新增數據行一樣

a

打開ColumnEdit  選擇new ButtenEdit  new上方會出現一個系統命名的button

命名可以更改必須在下發name中更改 是行的name

 

                         二

                        

 

                           

                             

                               

 

進入click事件就和普通的按鈕一樣了 可以編寫自己的代碼了

一下代碼是設計器中的代碼 供大家參考

// gridColumn_update
            // 
            this.gridColumn_update.Caption = "修改";
            this.gridColumn_update.ColumnEdit = this.repositoryItemButtonEdit_update;
            this.gridColumn_update.FieldName = "gridColumn_update";
            this.gridColumn_update.Name = "gridColumn_update";
            this.gridColumn_update.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
            this.gridColumn_update.Visible = true;
            this.gridColumn_update.VisibleIndex = 5;
            // 
            // repositoryItemButtonEdit_update
            // 
            this.repositoryItemButtonEdit_update.AutoHeight = false;
            serializableAppearanceObject1.Options.UseTextOptions = true;
            serializableAppearanceObject1.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            this.repositoryItemButtonEdit_update.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "修改", -1,           true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, null, new DevExpress.Utils.KeyShortcut(System.            Windows.Forms.Keys.None), serializableAppearanceObject1, "", null, null, true)});
            this.repositoryItemButtonEdit_update.Name = "repositoryItemButtonEdit_update";
            this.repositoryItemButtonEdit_update.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            this.repositoryItemButtonEdit_update.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(th          is.repositoryItemButtonEdit_update_ButtonClick);


 

DevExpress控件的屬性太多了 還需要大家進行一步的學習使用理解

如有錯誤 或更好的方法 歡迎大家指指出

 

發佈了38 篇原創文章 · 獲贊 13 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章