using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LUserControl.Properties;
using SourceGrid.Selection;
using ContentAlignment = DevAge.Drawing.ContentAlignment;
using Model.ResponseModels; namespace LUserControl
{
public partial class GridUc : UserControl
{
public SourceGrid.Grid DataGrid => grid;
public int GridHeight { get; set; }
/// <summary>
/// 最大行数10000
/// </summary>
public int RowMax { get; set; }
/// <summary>
/// 有无列头,0无,1有
/// </summary>
private int _top = ;
/// <summary>
/// 多选状态记录
/// </summary>
private bool[] IsChoiceLst = new bool[];
///切图回调函数,一个是开锁信息,一个是选中还是不选中
public Action<Object, bool> LCheckBoxAction; ///点击显示完整文字事件,文字,第几列
public Action<object, int> LTxtBoxAction; ///点击显示完整文字事件,文字,第几列
public Action<object> LDeleteAction;
//单击控制器
SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button();
//单击控制器
SourceGrid.Cells.Controllers.Button buttonTxtClickEvent = new SourceGrid.Cells.Controllers.Button(); //单击控制器
SourceGrid.Cells.Controllers.Button buttonDeleteClickEvent = new SourceGrid.Cells.Controllers.Button();
/// <summary>
/// 记录上一个点击cell
/// </summary>
private static SourceGrid.Cells.Cell _cell;
/// <summary>
///
/// </summary>
public GridUc()
{
InitializeComponent();
} /// <summary>
/// 添加到第一位状态
/// </summary>
private void AddIsChoice(bool isChoice)
{
for (int i = IsChoiceLst.Length - ; i > ; i--)
{
IsChoiceLst[i] = IsChoiceLst[i - ];
}
IsChoiceLst[] = isChoice;
} #region 加载grid数据
/// <summary>
/// 加载grid数据
/// </summary>
public void Grid_Load(List<Heaher> hearherLst, int height, int rowMax = )
{
buttonClickEvent.Executed += new EventHandler(CellButton_Click);
buttonTxtClickEvent.Executed += new EventHandler(CellButtonTxt_Click);
buttonDeleteClickEvent.Executed += new EventHandler(CellButtonDelete_Click);
RowMax = rowMax;
if (hearherLst == null)
{
_top = ;
return;
}
_top = ;
grid.Rows.Clear();
grid.ColumnsCount = hearherLst.Count; #region 标头样式 SourceGrid.Cells.Views.Cell titleModel = new SourceGrid.Cells.Views.Cell
{
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
BackColor = Color.FromArgb(, , ),
ForeColor = Color.White,
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter
}; #endregion
grid.Rows.Insert();
for (int i = ; i < hearherLst.Count; i++)
{
grid[, i] = new SourceGrid.Cells.Cell(hearherLst[i].Title) { View = titleModel };
grid.Columns[i].Width = hearherLst[i].Width;
}
grid.Rows[].Height = height;
} /// <summary>
/// 加载grid数据
/// </summary>
/// <param name="widthInts">列宽</param>
/// <param name="height">高度</param>
/// <param name="maxCount">不能超过的数量</param>
public void Grid_Load(int[] widthInts, int height = , int maxCount = )
{
_top = ;
grid.Rows.Clear();
grid.ColumnsCount = widthInts.Length;
GridHeight = height;
RowMax = maxCount; for (int i = ; i < widthInts.Length; i++)
{
grid.Columns[i].Width = widthInts[i];
}
}
#endregion #region 添加一条数据至第一位 /// <summary>
/// 添加一条数据至第一位
/// </summary>
/// <param name="stLst"></param>
/// <param name="tagObj">tag记录的对象</param>
public void AddItem(List<string> stLst, params Object[] tagObj)
{
if (stLst == null) return; //设置列
if (grid.ColumnsCount < stLst.Count)
{
grid.ColumnsCount = stLst.Count;
} SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, )
}; if (grid.Rows.Count % == )
{
captionModel.BackColor = Color.White;
}
else
{
captionModel.BackColor = Color.FromArgb(, , );
} grid.Rows.Insert(_top);
for (var i = ; i < stLst.Count && i < grid.ColumnsCount; i++)
{
//获取关键信息,这个关键信息只跟整条数据有关,如果多个就分别放在该条的单元格内
//跟该单元格并没什么关系
Object tag = "";
if (i < tagObj.Length)
{
tag = tagObj[i];
} if (stLst[i] == "False" || stLst[i] == "True")
{
grid[_top, i] = CreateImgCell(stLst[i], captionModel); }
else
{
grid[_top, i] = new SourceGrid.Cells.Cell(stLst[i]) { View = captionModel };
}
grid[_top, i].Tag = tag;
}
grid.Rows[_top].Height = GridHeight; //不能超过23
if (grid.RowsCount > RowMax)
{
grid.Rows.Remove(grid.RowsCount - );
} //grid.AutoSizeCells();
} /// <summary>
/// 添加一条数据至第一位,数据加颜色
/// </summary>
/// <param name="stLst"></param>
/// <param name="tagObj">tag记录的对象</param>
public void AddItemColor(List<string> stLst,int[] intColors, Color color, params Object[] tagObj)
{
if (stLst == null) return; //设置列
if (grid.ColumnsCount < stLst.Count)
{
grid.ColumnsCount = stLst.Count;
}
DevAge.Drawing.RectangleBorder b = new DevAge.Drawing.RectangleBorder();
b.SetWidth();
SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
ForeColor = color,
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
Border = b
};
SourceGrid.Cells.Views.Cell captionModel2 = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
Border = b
}; //if (grid.Rows.Count % 2 == 0)
//{
// captionModel.BackColor = Color.White;
//}
//else
//{
// captionModel.BackColor = Color.FromArgb(227, 241, 251);
//}
captionModel.BackColor = Color.FromArgb(, , );
captionModel2.BackColor = Color.FromArgb(, , );
grid.Rows.Insert(_top);
for (var i = ; i < stLst.Count && i < grid.ColumnsCount; i++)
{ //获取关键信息,这个关键信息只跟整条数据有关,如果多个就分别放在该条的单元格内
//跟该单元格并没什么关系
Object tag = "";
if (i < tagObj.Length)
{
tag = tagObj[i];
} if (stLst[i] == "False" || stLst[i] == "True")
{
grid[_top, i] = CreateImgCell(stLst[i], captionModel); }
else
{
grid[_top, i] = new SourceGrid.Cells.Cell(stLst[i]) { View = captionModel };
}
grid[_top, i].Tag = tag;
if (intColors.Contains(i))
{
grid[_top, i].View = captionModel;
}
else
{
grid[_top, i].View = captionModel2;
}
}
grid.Rows[_top].Height = GridHeight; //不能超过23
if (grid.RowsCount > RowMax)
{
grid.Rows.Remove(grid.RowsCount - );
} //grid.AutoSizeCells();
} /// <summary>
/// 添加一条数据至第一位,多选
/// </summary>
/// <param name="stLst"></param>
/// <param name="tagObj">tag记录的对象</param>
public void AddItem2(List<string> stLst, params Object[] tagObj)
{
if (stLst == null) return; //设置列
if (grid.ColumnsCount < stLst.Count)
{
grid.ColumnsCount = stLst.Count;
} SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, )
}; if (grid.Rows.Count % == )
{ captionModel.BackColor = Color.White;
}
else
{
captionModel.BackColor = Color.FromArgb(, , );
}
//提示控件
//SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
//toolTipController.ToolTipTitle = "完整数据";
//toolTipController.ToolTipIcon = ToolTipIcon.Info;
//toolTipController.IsBalloon = true;
grid.Rows.Insert(_top);
for (var i = ; i < stLst.Count && i < grid.ColumnsCount; i++)
{
//获取关键信息,这个关键信息只跟整条数据有关,如果多个就分别放在该条的单元格内
//跟该单元格并没什么关系
Object tag = "";
if (i < tagObj.Length)
{
tag = tagObj[i];
} if (stLst[i] == "False" || stLst[i] == "True" || stLst[i] == "No")
{
//每行只有一个
if (i == )
{
AddIsChoice(stLst[i] == "True");
}
grid[_top, i] = CreateImgCell(stLst[i], captionModel);
}
else
{
grid[_top, i] = new SourceGrid.Cells.Cell(stLst[i]) { View = captionModel }; //grid[_top, i].ToolTipText = stLst[i];
//grid[_top, i].AddController(toolTipController);
}
grid[_top, i].Tag = tag;
}
grid.Rows[_top].Height = GridHeight; //不能超过23
if (grid.RowsCount > RowMax)
{
grid.Rows.Remove(grid.RowsCount - );
} //grid.AutoSizeCells();
} /// <summary>
/// 添加一条数据至第一位,显示文字版
/// </summary>
/// <param name="stLst"></param>
/// <param name="tagObj">tag记录的对象</param>
public void AddItem3(List<string> stLst, int[] colInts, params Object[] tagObj)
{
if (stLst == null) return; //设置列
if (grid.ColumnsCount < stLst.Count)
{
grid.ColumnsCount = stLst.Count;
} SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, )
}; if (grid.Rows.Count % == )
{ captionModel.BackColor = Color.White;
}
else
{
captionModel.BackColor = Color.FromArgb(, , );
}
//提示控件
//SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
//toolTipController.ToolTipTitle = "完整数据";
//toolTipController.ToolTipIcon = ToolTipIcon.Info;
//toolTipController.IsBalloon = true;
grid.Rows.Insert(_top);
for (var i = ; i < stLst.Count && i < grid.ColumnsCount; i++)
{
//获取关键信息,这个关键信息只跟整条数据有关,如果多个就分别放在该条的单元格内
//跟该单元格并没什么关系
Object tag = "";
if (i < tagObj.Length)
{
tag = tagObj[i];
} if (stLst[i] == "False" || stLst[i] == "True")
{
//每行只有一个
if (i == )
{
AddIsChoice(stLst[i] == "True");
}
grid[_top, i] = CreateImgCell(stLst[i], captionModel);
}
else
{
grid[_top, i] = new SourceGrid.Cells.Cell(stLst[i]) { View = captionModel };
if (colInts.Contains(i))
{
//为按钮增加事件
grid[_top, i].AddController(buttonTxtClickEvent);
}
//grid[_top, i].ToolTipText = stLst[i];
//grid[_top, i].AddController(toolTipController);
}
grid[_top, i].Tag = tag;
}
grid.Rows[_top].Height = GridHeight; //不能超过23
if (grid.RowsCount > RowMax)
{
grid.Rows.Remove(grid.RowsCount - );
} //grid.AutoSizeCells();
} /// <summary>
/// 添加一条数据至第一位,指定位置是删除图标
/// </summary>
/// <param name="stLst"></param>
/// <param name="col">删除位置</param>
/// <param name="tagObj">tag记录的对象</param>
public void AddItemDelete(List<string> stLst, int col, Object tagObj)
{
if (stLst == null) return; //设置列
if (grid.ColumnsCount < stLst.Count)
{
grid.ColumnsCount = stLst.Count;
}
DevAge.Drawing.RectangleBorder b = new DevAge.Drawing.RectangleBorder();
b.SetWidth();
SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
Border = b
}; captionModel.BackColor = Color.FromArgb(, , );
//提示控件
//SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
//toolTipController.ToolTipTitle = "完整数据";
//toolTipController.ToolTipIcon = ToolTipIcon.Info;
//toolTipController.IsBalloon = true;
grid.Rows.Insert(_top);
for (var i = ; i < stLst.Count && i < grid.ColumnsCount; i++)
{
//获取关键信息,这个关键信息只跟整条数据有关,如果多个就分别放在该条的单元格内
//跟该单元格并没什么关系
Object tag = "";
if (i == col)
{
tag = tagObj;
} if (stLst[i] == "delete")
{
//每行只有一个
grid[_top, i] = CreateDeleteImgCell(captionModel);
}
else
{
grid[_top, i] = new SourceGrid.Cells.Cell(stLst[i]) { View = captionModel };
}
grid[_top, i].Tag = tag;
}
grid.Rows[_top].Height = GridHeight; //不能超过23
if (grid.RowsCount > RowMax)
{
grid.Rows.Remove(grid.RowsCount - );
} }
#region 点击事件
private SourceGrid.Cells.Cell CreateImgCell(string isCheck, SourceGrid.Cells.Views.Cell captionModel)
{
//单击控制器
SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button();
buttonClickEvent.Executed += new EventHandler(CellButton_Click); SourceGrid.Cells.Cell cell = new SourceGrid.Cells.Cell("");
switch (isCheck)
{
case "True":
case "False":
cell.Image = isCheck == "True" ? Resources.check_box : Resources.check_def;
//为按钮增加事件
cell.AddController(buttonClickEvent);
break;
case "No":
cell.Image = Resources.check_grey;
break;
}
captionModel.ImageAlignment = ContentAlignment.MiddleCenter;
cell.View = captionModel;
return cell;
} private SourceGrid.Cells.Cell CreateDeleteImgCell(SourceGrid.Cells.Views.Cell captionModel)
{
//单击控制器
SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button();
buttonClickEvent.Executed += new EventHandler(CellButtonDelete_Click); SourceGrid.Cells.Cell cell = new SourceGrid.Cells.Cell("");
cell.Image = Resources.deleted;
captionModel.ImageAlignment = ContentAlignment.MiddleCenter;
cell.View = captionModel;
//为按钮增加事件
cell.AddController(buttonClickEvent); return cell;
}
#endregion #endregion #region 按钮单击事件 /// <summary>
/// 按钮选中单击删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CellButtonDelete_Click(object sender, EventArgs e)
{
SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
SourceGrid.Cells.Cell btnCell = (SourceGrid.Cells.Cell)context.Cell; //MessageBox.Show(btnCell.Column.Index.ToString() + ":" + btnCell.Row.Index.ToString());
int currenRow = btnCell.Row.Index;
grid.Columns.StretchToFit();
LDeleteAction?.Invoke(btnCell.Tag); } /// <summary>
/// 按钮选中单击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CellButton_Click(object sender, EventArgs e)
{
SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
SourceGrid.Cells.Cell btnCell = (SourceGrid.Cells.Cell)context.Cell;
#region 切换图片,单选形式 if (IsChoiceLst[btnCell.Row.Index])
{
btnCell.Image = Resources.check_def;
}
else
{
btnCell.Image = Resources.check_box;
}
IsChoiceLst[btnCell.Row.Index] = !IsChoiceLst[btnCell.Row.Index];
#endregion //MessageBox.Show(btnCell.Column.Index.ToString() + ":" + btnCell.Row.Index.ToString());
int currenRow = btnCell.Row.Index;
grid.Columns.StretchToFit();
LCheckBoxAction?.Invoke(btnCell.Tag, IsChoiceLst[btnCell.Row.Index]); }
/// <summary>
/// 按钮单击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CellButtonTxt_Click(object sender, EventArgs e)
{
SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
SourceGrid.Cells.Cell btnCell = (SourceGrid.Cells.Cell)context.Cell; //MessageBox.Show(btnCell.Column.Index.ToString() + ":" + btnCell.Row.Index.ToString());
int currenCol = btnCell.Column.Index;
grid.Columns.StretchToFit();
LTxtBoxAction?.Invoke(btnCell.DisplayText, currenCol); }
#endregion #region 改变指定列数据的位置的数据 /// <summary>
/// 改变指定列数据的位置的数据,该项目只有取详情里用到
///
/// </summary>
/// <param name="col"></param>
/// <param name="data"></param>
/// <param name="newSt"></param>
public void SetCell(int col, string data, int changeCol, string newSt,Color fColor,Color bColor)
{
//ForeColor = Color.FromArgb(124, 178, 7),
// Font = new Font("微软雅黑", 15F, FontStyle.Regular,
// GraphicsUnit.Point, 134),
// BackColor = Color.FromArgb(211, 211, 211)
SourceGrid.Cells.Views.Cell captionModel3 = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
ForeColor = fColor,
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
BackColor = bColor
}; for (int j = ; j < DataGrid.RowsCount; j++)
{
var temp = DataGrid[j, col].Tag as Check;
if (temp.epcId == data)
{
DataGrid[j, changeCol] = new SourceGrid.Cells.Cell(newSt) { View = captionModel3 };
}
}
grid.Columns.StretchToFit();
}
/// <summary>
/// 还原选中列为可选
/// </summary>
/// <param name="col">指定列</param>
/// <param name="data">找到标识行</param>
/// <param name="changeCol">改变的列</param>
/// <param name="tagObj">该列带的对象</param>
public void ReductionCell(int col, string data, int changeCol, object tagObj)
{
SourceGrid.Cells.Views.Cell captionModel3 = new SourceGrid.Cells.Views.Cell
{
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft,
ForeColor = Color.FromArgb(, , ),
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, ),
BackColor = Color.FromArgb(, , )
}; for (int j = ; j < DataGrid.RowsCount; j++)
{
var temp = DataGrid[j, col].Tag as FindInfoPageRp;
if (temp.id == data)
{
if (j % == )
{ captionModel3.BackColor = Color.White;
}
else
{
captionModel3.BackColor = Color.FromArgb(, , );
}
DataGrid[j, changeCol] = CreateImgCell("False", captionModel3);
DataGrid[j, changeCol].Tag = tagObj;
}
}
grid.Columns.StretchToFit();
} #endregion
#region 清掉除了标头
/// <summary>
/// 清掉除了标头
/// </summary>
public void Clear()
{
int count = grid.RowsCount - _top;
for (int i = ; i < count; i++)
{
grid.Rows.Remove(_top);
}
} #endregion private void GridUc_Load(object sender, EventArgs e)
{
grid.Redim(, ); SourceGrid.Cells.Views.Cell titleModel =
new SourceGrid.Cells.Views.Cell
{
BackColor = Color.FromArgb(, , ),
ForeColor = Color.White,
TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter,
Font = new Font("微软雅黑", 15F, FontStyle.Regular,
GraphicsUnit.Point, )
}; SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell { BackColor = grid.BackColor }; int currentRow = ; //#region Base Types //grid.Rows.Insert(0);
//grid[currentRow, 0] = new SourceGrid.Cells.Cell("编码") {View = titleModel};
//grid[currentRow, 1] = new SourceGrid.Cells.Cell("打印") {View = titleModel};
//grid[currentRow, 2] = new SourceGrid.Cells.Cell("校验") { View = titleModel };
//grid[currentRow, 3] = new SourceGrid.Cells.Cell("发行时间") { View = titleModel }; //#endregion GridHeight = ;
//grid.Rows[0].Height = GridHeight;
//grid.Columns[0].Width = 225;
//grid.Columns[1].Width = 75;
//grid.Columns[2].Width = 75;
//grid.Columns[3].Width = 125;
// 选择行
grid.SelectionMode = SourceGrid.GridSelectionMode.Cell; //选择框的大小
var selection = grid.Selection as SelectionBase;
if (selection != null)
{
DevAge.Drawing.RectangleBorder b = selection.Border;
b.SetWidth();
selection.Border = b;
}
grid.Columns.StretchToFit();
grid.AutoSizeCells();
//List<string> lst = new List<string>();
//lst.Add("False");
//lst.Add("身份证身份证");
//AddItem(lst, "1"); //List<string> lst = new List<string>();
//lst.Add("32132132132");
//lst.Add("false");
//lst.Add("true");
//lst.Add(DateTime.Now.ToString());
//AddItem(lst); //int[] wInts = new[] { 80, 80, 120, 220, 90 };
//Grid_Load(wInts, 45, 6);
//List<string> stList = new List<string>();
//stList.Add("False");
//stList.Add("白正伟");
//stList.Add("*****5526");
//stList.Add("2018-01-08 18:07");
//stList.Add("在库");
//for (int i = 0; i < 20; i++)
//{
// AddItem(stList);
//} //int[] wInts = new[] { 70, 100, 110, 80 };
//Grid_Load(wInts, 45, 7);
//List<string> stList = new List<string>();
//stList.Add("槽1");
//stList.Add("白正伟");
//stList.Add("*****5526");
//stList.Add("待取");
//for (int i = 0; i < 20; i++)
//{
// AddItemColor(stList,new int[] { 3}, Color.FromArgb(2, 168, 243));
//}
//查看
int[] wInts = new[] { , , , };
Grid_Load(wInts, , );
List<string> stList = new List<string>();
stList.Add("白正伟");
stList.Add("*****5526");
stList.Add("2018-01-08 18:07");
stList.Add("");
for (int i = ; i < ; i++)
{
AddItem(stList);
}
}
} public class Heaher
{
/// <summary>
/// 文字
/// </summary>
public string Title { get; set; }
/// <summary>
/// 高度
/// </summary>
public int Width { get; set; }
}
}
namespace LUserControl
{
partial class GridUc
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region 组件设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.grid = new SourceGrid.Grid();
this.SuspendLayout();
//
// grid
//
this.grid.Dock = System.Windows.Forms.DockStyle.Fill;
this.grid.EnableSort = true;
this.grid.Location = new System.Drawing.Point(, );
this.grid.Name = "grid";
this.grid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows;
this.grid.SelectionMode = SourceGrid.GridSelectionMode.Cell;
this.grid.Size = new System.Drawing.Size(, );
this.grid.TabIndex = ;
this.grid.TabStop = true;
this.grid.ToolTipText = "";
//
// GridUc
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.grid);
this.Name = "GridUc";
this.Size = new System.Drawing.Size(, );
this.Load += new System.EventHandler(this.GridUc_Load);
this.ResumeLayout(false); } #endregion private SourceGrid.Grid grid;
}
}

显示列表控件(引用SourceGrid)的更多相关文章

  1. iOS项目开发实战——学会使用TableView列表控件(四)plist读取与Section显示

    文本将会实现把数据存储到plist文件里.然后在程序中进行读取.在TableView控件中依据不同的类别显示Section. 有关TableView 的其它实现,请參考<iOS项目开发实战--学 ...

  2. WPF自定义控件与样式(7)-列表控件DataGrid与ListView自定义样式

    一.前言 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要内容: Dat ...

  3. DataGridView控件-[引用]

    DataGridView控件 DataGridView是用于Windows Froms 2.0的新网格控件.它可以取代先前版本中DataGrid控件,它易于使用并高度可定制,支持很多我们的用户需要的特 ...

  4. UWP开发必备:常用数据列表控件汇总比较

    今天是想通过实例将UWP开发常用的数据列表做汇总比较,作为以后项目开发参考.UWP开发必备知识点总结请参照[UWP开发必备以及常用知识点总结]. 本次主要讨论以下控件: GridView:用于显示数据 ...

  5. 【转】silverlight telerik RadGridView 列头显示其他控件

    <telerik:GridViewDataColumn DataMemberBinding="{Binding target_id}" IsFilterable=" ...

  6. Flex 列表控件中的操作

    主要操作包括:显示提示,使用图标,编辑列表条目中数据. 1.使用数据提示: 当鼠标停留在条目上时,可以显示该条目的相关数据提示. 当利用滚动条时,可以显示滚动条的相关提示. 在列表控件中使用showD ...

  7. VC++ 列表控件的使用方法

    列表控件可以看作是功能增强的ListBox,它提供了四种风格,而且可以同时显示一列的多中属性值.MFC中使用CListCtrl类来封装列表控件的各种操作. 通过调用BOOL Create( DWORD ...

  8. Android自定义标签列表控件LabelsView解析

    版权声明:本文为博主原创文章,未经博主允许不得转载. 无论是在移动端的App,还是在前端的网页,我们经常会看到下面这种标签的列表效果:   标签从左到右摆放,一行显示不下时自动换行.这样的效果用And ...

  9. WPF: 实现带全选复选框的列表控件

    本文将说明如何创建一个带全选复选框的列表控件.其效果如下图:     这个控件是由一个复选框(CheckBox)与一个 ListView 组合而成.它的操作逻辑: 当选中“全选”时,列表中所有的项目都 ...

随机推荐

  1. Python面试题目之列表去重并维持原来顺序

    题目: 列表去掉重复元素,并保持原来的排序 方法一: # 待处理的列表 L1 = [111,44,55,33,22,11] # 利用集合set的属性,去重 s1 = set(L1) # 把集合转化为列 ...

  2. 20145326 《Java程序设计》第9周学习总结

    20145326 <Java程序设计>第9周学习总结 教材学习内容总结 第十六章 一.JDBC入门 1.JDBC简介 JDBC是用于执行SQL的解决方案,开发人员使用JDBC的标准接口,数 ...

  3. SPOJ BALNUM Balanced Numbers(数位DP+状态压缩)题解

    思路: 把0~9的状态用3进制表示,数据量3^10 代码: #include<cstdio> #include<map> #include<set> #includ ...

  4. SpringMVC整个执行流程

    在SSM (或SSH) 框架整合使用后,基本骨架看上去还是MVC的结构. MyBatis整合一些数据封装方法节省了DAO层的代码量, Spring提供了AOP,IoC( DI 具体实现 ). 而Spr ...

  5. Axios 使用采坑经验

    报错信息:Uncaught (in promise) DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL 解 ...

  6. KMP&拓展KMP

    KMP算法 说明 KMP算法是一种比较高效的字符串匹配算法,可以在线性时间内求出一个串在另一个串的所有匹配位置. 解析 详解KMP 设模板串是 \(pattern\) 令 \(next[i] = ma ...

  7. .Net web 关于表单标题

    今天跟以前同事学到一个好东西,就是后台web界面表单标题展示的一个方法,新学到的一个方法...赶紧分享一下 在model 属性上加  [DisplayName("标题"), Req ...

  8. TCGA下载神器--TCGAbiolinks

    http://bioconductor.org/packages/devel/bioc/vignettes/TCGAbiolinks/inst/doc/tcgaBiolinks.html#gdcque ...

  9. iOS线程之——NSCondition

    多线程在各种编程语言中都是难点,很多语言中实现起来很麻烦,objective-c虽然源于c,但其多线程编程却相当简单,可以与java相媲美.这篇文章主要从线程创建与启动.线程的同步与锁.线程的交互.线 ...

  10. 一定要用Windows自带的记事本编辑 applicationHost.config

    访问IIS时,发生了一个 HipIISEngineStub.dll不能读取的问题.(Windows Event可以确认). 很容易在网上找到了对策, http://chrisfleischhacker ...