📄 dlgchooseadvmodel.cs
字号:
using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Windows.Forms;using System.Data;namespace WWAM.Forms.Dlg{ public class DlgChooseAdvModel : WWAM.Forms.Dlg.DlgBase {
#region DlgChooseAdvModel
private DevExpress.XtraGrid.GridControl gcAdvModel;
private DevExpress.XtraGrid.Views.Grid.GridView gvAdvModel;
private DevExpress.XtraGrid.Columns.GridColumn colCode;
private DevExpress.XtraGrid.Columns.GridColumn colPaperName;
private DevExpress.XtraGrid.Columns.GridColumn colPaperSpaceNum;
private DevExpress.XtraGrid.Columns.GridColumn colPaperSpace;
private DevExpress.XtraGrid.Columns.GridColumn colAdvSpec;
private DevExpress.XtraGrid.Columns.GridColumn colColor;
private DevExpress.XtraGrid.Columns.GridColumn colPayUnit; private System.ComponentModel.IContainer components = null; public DlgChooseAdvModel() { // 该调用是 Windows 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitializeComponent 调用后添加任何初始化 } public DlgChooseAdvModel(Form form):base(form) { // 该调用是 Windows 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitializeComponent 调用后添加任何初始化 } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region 设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.gcAdvModel = new DevExpress.XtraGrid.GridControl();
this.gvAdvModel = new DevExpress.XtraGrid.Views.Grid.GridView();
this.colCode = new DevExpress.XtraGrid.Columns.GridColumn();
this.colPaperName = new DevExpress.XtraGrid.Columns.GridColumn();
this.colPaperSpaceNum = new DevExpress.XtraGrid.Columns.GridColumn();
this.colPaperSpace = new DevExpress.XtraGrid.Columns.GridColumn();
this.colAdvSpec = new DevExpress.XtraGrid.Columns.GridColumn();
this.colColor = new DevExpress.XtraGrid.Columns.GridColumn();
this.colPayUnit = new DevExpress.XtraGrid.Columns.GridColumn();
((System.ComponentModel.ISupportInitialize)(this.gcAdvModel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gvAdvModel)).BeginInit();
this.SuspendLayout();
//
// btnAccept
//
this.btnAccept.Location = new System.Drawing.Point(360, 328);
this.btnAccept.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
this.btnAccept.LookAndFeel.UseWindowsXPTheme = false;
this.btnAccept.Name = "btnAccept";
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(456, 328);
this.btnCancel.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
this.btnCancel.LookAndFeel.UseWindowsXPTheme = false;
this.btnCancel.Name = "btnCancel";
//
// gcAdvModel
//
this.gcAdvModel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
//
// gcAdvModel.EmbeddedNavigator
//
this.gcAdvModel.EmbeddedNavigator.Buttons.Append.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.Edit.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.NextPage.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.PrevPage.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Buttons.Remove.Visible = false;
this.gcAdvModel.EmbeddedNavigator.Name = "";
this.gcAdvModel.EmbeddedNavigator.TextStringFormat = "第 {0} 条 / 共 {1} 条";
this.gcAdvModel.Location = new System.Drawing.Point(8, 8);
this.gcAdvModel.MainView = this.gvAdvModel;
this.gcAdvModel.Name = "gcAdvModel";
this.gcAdvModel.Size = new System.Drawing.Size(536, 304);
this.gcAdvModel.TabIndex = 6;
this.gcAdvModel.UseEmbeddedNavigator = true;
this.gcAdvModel.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gvAdvModel});
//
// gvAdvModel
//
this.gvAdvModel.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.colCode,
this.colPaperName,
this.colPaperSpaceNum,
this.colPaperSpace,
this.colAdvSpec,
this.colColor,
this.colPayUnit});
this.gvAdvModel.GridControl = this.gcAdvModel;
this.gvAdvModel.Name = "gvAdvModel";
this.gvAdvModel.OptionsCustomization.AllowFilter = false;
this.gvAdvModel.OptionsMenu.EnableFooterMenu = false;
this.gvAdvModel.OptionsMenu.EnableGroupPanelMenu = false;
this.gvAdvModel.OptionsView.ColumnAutoWidth = false;
this.gvAdvModel.OptionsView.ShowGroupPanel = false;
this.gvAdvModel.Layout += new System.EventHandler(this.View_Layout);
//
// colCode
//
this.colCode.Caption = "模版编号";
this.colCode.FieldName = "Code";
this.colCode.Name = "colCode";
this.colCode.Visible = true;
this.colCode.VisibleIndex = 0;
this.colCode.Width = 86;
//
// colPaperName
//
this.colPaperName.Caption = "报刊名称";
this.colPaperName.FieldName = "PaperName";
this.colPaperName.Name = "colPaperName";
this.colPaperName.Width = 106;
//
// colPaperSpaceNum
//
this.colPaperSpaceNum.Caption = "版号";
this.colPaperSpaceNum.FieldName = "PaperSpaceNum";
this.colPaperSpaceNum.Name = "colPaperSpaceNum";
this.colPaperSpaceNum.Visible = true;
this.colPaperSpaceNum.VisibleIndex = 1;
this.colPaperSpaceNum.Width = 59;
//
// colPaperSpace
//
this.colPaperSpace.Caption = "版面";
this.colPaperSpace.FieldName = "PaperSpace";
this.colPaperSpace.Name = "colPaperSpace";
this.colPaperSpace.Visible = true;
this.colPaperSpace.VisibleIndex = 2;
this.colPaperSpace.Width = 100;
//
// colAdvSpec
//
this.colAdvSpec.Caption = "规格";
this.colAdvSpec.FieldName = "AdvSpec";
this.colAdvSpec.Name = "colAdvSpec";
this.colAdvSpec.Visible = true;
this.colAdvSpec.VisibleIndex = 3;
this.colAdvSpec.Width = 142;
//
// colColor
//
this.colColor.Caption = "色彩";
this.colColor.FieldName = "Color";
this.colColor.Name = "colColor";
this.colColor.Visible = true;
this.colColor.VisibleIndex = 4;
this.colColor.Width = 69;
//
// colPayUnit
//
this.colPayUnit.Caption = "单位";
this.colPayUnit.FieldName = "PayUnit";
this.colPayUnit.Name = "colPayUnit";
this.colPayUnit.Visible = true;
this.colPayUnit.VisibleIndex = 5;
this.colPayUnit.Width = 76;
//
// DlgChooseAdvModel
//
this.AcceptButton = this.btnAccept;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(554, 368);
this.Controls.Add(this.gcAdvModel);
this.Name = "DlgChooseAdvModel";
this.Controls.SetChildIndex(this.btnCancel, 0);
this.Controls.SetChildIndex(this.btnAccept, 0);
this.Controls.SetChildIndex(this.gcAdvModel, 0);
((System.ComponentModel.ISupportInitialize)(this.gcAdvModel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gvAdvModel)).EndInit();
this.ResumeLayout(false);
} #endregion #endregion
#region Varable && Property public DataRow drAdvModel { get { return gvAdvModel.GetDataRow(gvAdvModel.FocusedRowHandle); } } #endregion #region FromEvent protected override void OnFormLoad()
{
this.setLayoutFileName("AdvModelChoose");
this.ViewLoadLayout(this.gvAdvModel);
}
protected override void OnFormClose()
{
this.ViewSaveLayout(this.gvAdvModel);
}
#endregion #region CanClose protected override bool CanClose()
{
if(drAdvModel==null)
{
this.gcAdvModel.Focus();
return false;
}
return base.CanClose ();
}
#endregion #region OnFormShow protected override void OnFormShow()
{ base.OnFormShow (); this.gcAdvModel.Focus(); } #endregion #region ShowDialog public DialogResult ShowDialog(string title, DataTable dtAdvModel) { this.Text = title; this.gcAdvModel.DataSource = dtAdvModel; return base.ShowDialog(); } #endregion
}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -