[Original] XAF ListView frozen column

Source: Internet
Author: User

usingSystem;usingSystem.ComponentModel;usingSystem.Collections.Generic;usingSystem.Diagnostics;usingSystem.Text;usingDevexpress.expressapp;usingDevExpress.ExpressApp.Actions;usingDevExpress.Persistent.Base;usingDevExpress.ExpressApp.Win.Editors;usingDevExpress.XtraGrid.Views.Grid;usingDevExpress.XtraGrid.Columns;usingDevExpress.Utils.Menu;usingDevExpress.XtraGrid.Menu;usingSystem.Drawing;usingDevExpress.ExpressApp.Utils;namespaceE1554. module{ Public Partial classFixclomunviewcontroller:viewcontroller<listview>    {         PublicFixclomunviewcontroller () {InitializeComponent (); }        protected Override voidondeactivated () {Base.                    Ondeactivated (); }        protected Override voidonviewcontrolscreated () {Base.            Onviewcontrolscreated (); //Access and customize the target View control.Gridlisteditor ListEditor = ((ListView) View). Editor asGridlisteditor; if(ListEditor! =NULL) {Xafgridview GridView= Listeditor.gridview asXafgridview; Gridview.popupmenushowing+=NewPopupmenushowingeventhandler (gridview_popupmenushowing); }        }        Private voidGridview_popupmenushowing (Objectsender, Popupmenushowingeventargs e) {            if(E.menutype = =DevExpress.XtraGrid.Views.Grid.GridMenuType.Column) {DevExpress.XtraGrid.Menu.GridViewColu Mnmenu Menu= E.menu asGridviewcolumnmenu; if(menu. Column! =NULL)                {                                      //Adding New ItemsDxpopupmenu Popmenu =NewDxpopupmenu (); Popmenu.caption="Frozen List"; Menu.                    Items.Add (Popmenu); POPMENU.ITEMS.ADD (Createcheckitem ("Cancel", menu. Column, Fixedstyle.none, ImageLoader.Instance.GetImageInfo ("notfixed").                    Image)); POPMENU.ITEMS.ADD (Createcheckitem ("left side", menu. Column, Fixedstyle.left, ImageLoader.Instance.GetImageInfo ("Fixedleft").                    Image)); POPMENU.ITEMS.ADD (Createcheckitem ("Right side", menu. Column, Fixedstyle.right, ImageLoader.Instance.GetImageInfo ("Fixedright").                Image)); }                            }        }        //Create a menu itemDxmenucheckitem Createcheckitem (stringcaption, gridcolumn column, Fixedstyle style, image image) {Dxmenucheckitem Item=NewDxmenucheckitem (caption, column. Fixed = =style, image,NewEventHandler (Onfixedclick)); Item. Tag=Newmenuinfo (column, style); returnitem; }        //Menu Item Click handler        voidOnfixedclick (Objectsender, EventArgs e) {Dxmenuitem Item= Sender asDxmenuitem; Menuinfo Info= Item. Tag asMenuinfo; if(Info = =NULL)return; Info. Column.fixed=info.        Style; }        //The class that stores menu specific information        classMenuinfo { Publicmenuinfo (gridcolumn column, Fixedstyle style) { This. Column =column;  This. Style =style; }             PublicFixedstyle Style;  PublicGridColumn Column; }    }}

[Original] XAF ListView frozen column

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.