首页 > 代码库 > [原] XAF 如何啟用ListView橫向滾動條
[原] XAF 如何啟用ListView橫向滾動條
using System;using DevExpress.ExpressApp;using DevExpress.ExpressApp.Win.Editors;using DevExpress.Utils.Menu;using DevExpress.XtraGrid.Menu;using DevExpress.XtraGrid.Views.Grid;namespace CommonModule.Common.Controlers{ public class ListViewFooterMenuViewController : ViewController { public ListViewFooterMenuViewController() { TargetViewType = ViewType.ListView; } GridListEditor _listEditor; protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); _listEditor = ((ListView)View).Editor as GridListEditor; if (_listEditor == null) return; _listEditor.GridView.PopupMenuShowing += GridView_PopupMenuShowing; _listEditor.GridView.OptionsView.ColumnAutoWidth = false;//啟用滾動條 } void GridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.MenuType != GridMenuType.Column) return; var menu = e.Menu as GridViewColumnMenu; if (menu == null) return; string menuCaption; if (_listEditor.GridView.OptionsView.ShowFooter) menuCaption = "Hide Footer"; else menuCaption = "Show Footer"; var item = new DXMenuCheckItem(menuCaption,_listEditor.GridView.OptionsView.ShowFooter, null, OnDrempelItemClick); menu.Items.Add(item); } private void OnDrempelItemClick(object sender, EventArgs e) { _listEditor.GridView.OptionsView.ShowFooter = !_listEditor.GridView.OptionsView.ShowFooter; } protected override void OnDeactivated() { base.OnDeactivated(); if (_listEditor == null || _listEditor.GridView == null) return; _listEditor.GridView.PopupMenuShowing -= GridView_PopupMenuShowing; } } }
[原] XAF 如何啟用ListView橫向滾動條
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。