/// <summary> /// 그리드 초기화 /// </summary> /// <param name="e"></param> void grd_InitializeCell(CellDataBoundEventArgs e) { Label lbl = null; switch (e.Cell.ColumnIndex) { case 0: case 1: lbl = new Label() { TextAlign = ContentAlignment.MiddleLeft, AutoSize = false, Left = 0, Top = 0, Width = e.Cell.Width, Height = e.Cell.Height, BackColor = Color.Transparent }; e.Cell.Controls.Add(lbl); break; default: break; } }
/// <summary> /// Make grid with 4 cells/row /// </summary> /// <param name="e"></param> private void PQ11Grid_BuildCells(CellDataBoundEventArgs e) { Label lbl = null; InputText input = null; switch (e.Cell.ColumnIndex) { case 0: case 4: // label for indexing lbl = new Label() { AutoSize = false, Left = 1, Top = 1, Width = e.Cell.Width - 2, Height = e.Cell.Height - 2, TextAlign = e.Cell.ColumnIndex == 0 ? ContentAlignment.MiddleCenter : ContentAlignment.MiddleLeft, //BackColor = Color.Transparent }; e.Cell.Controls.Add(lbl); break; default: input = new InputText() { DataType = e.Cell.ColumnIndex == 1 ? InputTextDataType.Text : InputTextDataType.Numeric, Format = e.Cell.ColumnIndex == 1 ? string.Empty : "#,###", TextAlign = e.Cell.ColumnIndex == 1 ? ContentAlignment.MiddleCenter : ContentAlignment.MiddleRight, ReadOnly = false, HasBorder = true, Left = 1, Top = 1, Width = e.Cell.Width - 2, Height = e.Cell.Height - 2, BorderWidth = 1, Corner = 1, MaxLength = e.Cell.ColumnIndex == 1 ? 13 : 9, Padding = new Padding(0, 0, 2, 0), BorderColor = System.Drawing.Color.FromArgb(187, 187, 187), Focusable = true, //BackColor = Color.Transparent }; if (e.Cell.ColumnIndex == 2 || e.Cell.ColumnIndex == 3) { input.Format = "#,##0"; } e.Cell.Controls.Add(input); break; } }
void saleGridPanel1_InitializeCell(CellDataBoundEventArgs e) { Label lbl = new Label() { Text = string.Empty, AutoSize = false, Dock = DockStyle.Fill }; e.Cell.Controls.Add(lbl); }
void saleGridPanel1_CellDataBound(CellDataBoundEventArgs e) { List <string> values = e.ItemData as List <string>; if (values != null) { e.Cell.Controls[0].Text = values[e.Cell.ColumnIndex]; } else { e.Cell.Controls[0].Text = string.Empty; } }
void PQ12Grid_BuildCells(CellDataBoundEventArgs e) { Label lbl = null; switch (e.Cell.ColumnIndex) { case 1: lbl = new Label() { TextAlign = ContentAlignment.MiddleLeft, AutoSize = false, Dock = DockStyle.Fill }; e.Cell.Controls.Add(lbl); break; case 7: lbl = new Label() { TextAlign = ContentAlignment.MiddleRight, AutoSize = false, Dock = DockStyle.Fill }; e.Cell.Controls.Add(lbl); break; default: lbl = new Label() { TextAlign = ContentAlignment.MiddleCenter, AutoSize = false, Dock = DockStyle.Fill }; e.Cell.Controls.Add(lbl); break; } }
/// <summary> /// GRID내용만들기 /// </summary> /// <param name="e"></param> void ItemsGrid_InitializeCell(CellDataBoundEventArgs e) { ItemsGrid_BuildRowCells(e.Cell); }
void PQ11Grid_BuildCells(CellDataBoundEventArgs e) { Label lbl = null; InputText input = null; WSWD.WmallPos.POS.FX.Win.UserControls.Button btn = null; switch (e.Cell.ColumnIndex) { case 0: lbl = new Label() { TextAlign = ContentAlignment.MiddleCenter, AutoSize = false, Left = 0, Top = 0, Width = e.Cell.Width, Height = e.Cell.Height, BackColor = Color.Transparent }; e.Cell.Controls.Add(lbl); break; case 1: lbl = new Label() { TextAlign = ContentAlignment.MiddleLeft, AutoSize = false, Left = 0, Top = 0, Width = e.Cell.Width, Height = e.Cell.Height, BackColor = Color.Transparent }; e.Cell.Controls.Add(lbl); break; case 3: btn = new WSWD.WmallPos.POS.FX.Win.UserControls.Button() { TextAlign = ContentAlignment.MiddleCenter, Left = 1, Top = 1, Width = e.Cell.Width - 2, Height = e.Cell.Height - 2, Visible = false }; btn.Click += new EventHandler(GiftNoBtn_Click); e.Cell.Controls.Add(btn); break; case 2: case 4: lbl = new Label() { TextAlign = ContentAlignment.MiddleRight, AutoSize = false, Left = 0, Top = 0, Width = e.Cell.Width, Height = e.Cell.Height, BackColor = Color.Transparent }; e.Cell.Controls.Add(lbl); break; case 8: input = new InputText() { DataType = WSWD.WmallPos.POS.FX.Shared.InputTextDataType.Numeric, Format = "#,###", TextAlign = ContentAlignment.MiddleCenter, ReadOnly = false, HasBorder = true, Left = 1, Top = 1, Width = e.Cell.Width - 2, Height = e.Cell.Height - 2, BorderWidth = 1, Corner = 1, MaxLength = 1, Padding = new Padding(0, 0, 2, 0), BorderColor = System.Drawing.Color.FromArgb(187, 187, 187), Focusable = true, BackColor = Color.White }; input.InputLostFocused += new EventHandler(input_InputLostFocused); input.KeyEvent += new WSWD.WmallPos.FX.Shared.OPOSKeyEventHandler(input_KeyEvent); e.Cell.Controls.Add(input); break; default: input = new InputText() { Left = 1, Top = 1, Width = e.Cell.Width - 2, Height = e.Cell.Height - 2, DataType = WSWD.WmallPos.POS.FX.Shared.InputTextDataType.Numeric, Format = "#,###", TextAlign = ContentAlignment.MiddleRight, ReadOnly = e.Cell.ColumnIndex == 6, HasBorder = true, BorderWidth = 1, Padding = new Padding(0, 0, 2, 0), Corner = 1, MaxLength = 8, BorderColor = System.Drawing.Color.FromArgb(187, 187, 187), Focusable = true, BackColor = Color.White }; input.InputLostFocused += new EventHandler(input_InputLostFocused); e.Cell.Controls.Add(input); break; } }