操作List View(添加tooltip到List View的列頭)

  • Since you are going to access the settings of the List View's grid control, you need to ensure it has already been created. That's why you need to subscribe to the Controller's ViewControlsCreated event. 

    using DevExpress.Web.ASPxGridView;
    using DevExpress.ExpressApp.Web.Editors.ASPx;
    //...
    private void WebTooltipController_ViewControlsCreated(object sender, EventArgs e) {
        ASPxGridListEditor listEditor = ((ListView)View).Editor as ASPxGridListEditor;
        if (listEditor != null) {
            foreach (GridViewColumn column in listEditor.Grid.Columns) {
                if ((column as GridViewDataColumnWithInfo) != null)
                    column.ToolTip = "Click to sort by " + column.Caption;
            }
        }
    }
    


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