Resizing Combo Dropdown Columns

xiaoxiao2021-02-27  198

using Infragistics.Win.UltraWinGrid; public class Script { // Add Custom Module Level Variables Here ** private Erp.UI.Controls.Combos.JobMtlSearchCombo cboPOLnMtl; public void InitializeCustomCode() { // Begin Wizard Added Custom Method Calls   cboPOLnMtl= (Erp.UI.Controls.Combos.JobMtlSearchCombo)csm.GetNativeControlReference("Your_Control_GUID_Here");   this.cboPOLnMtl.BeforeDropDown += new System.ComponentModel.CancelEventHandler(this.cboPOLnMtl_BeforeDropDown);   this.cboPOLnMtl.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.cboPOLnMtl_InitializeLayout); // End Wizard Added Custom Method Calls } public void DestroyCustomCode() { // Begin Custom Code Disposal   this.cboPOLnMtl.BeforeDropDown -= new System.ComponentModel.CancelEventHandler(this.cboPOLnMtl_BeforeDropDown);   this.cboPOLnMtl.InitializeLayout -= new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.cboPOLnMtl_InitializeLayout);   cboPOLnMtl = null; // End Custom Code Disposal } // Following allows column sizing private void cboPOLnMtl_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)   {   args.Layout.Override.AllowColSizing = AllowColSizing.Free;   args.Layout.PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand,true);   } // Following sets drop down and/or column widths. private void cboPOLnMtl_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs args) {   //cboPOLnMtl.DropDownWidth = 200;   cboPOLnMtl.DisplayLayout.Bands[0].Columns[0].Width = 30;   cboPOLnMtl.DisplayLayout.Bands[0].Columns[1].Width = 80; } }
转载请注明原文地址: https://www.6miu.com/read-11648.html

最新回复(0)