本文整理汇总了C#中System.Windows.Forms.DataGridViewImageColumn类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewImageColumn类的具体用法?C# DataGridViewImageColumn怎么用?C# DataGridViewImageColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewImageColumn类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewImageColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadTutorial
private void LoadTutorial()
{
tutorialGridView.Rows.Clear();
tutorialGridView.Columns.Clear();
string[] imagePaths = Directory.GetFiles(GestureStudio.GestureImagePath);
for (int i = 0; i < imagePaths.Length / 3; i++)
{
DataGridViewImageColumn ImageColumn = new System.Windows.Forms.DataGridViewImageColumn() { HeaderText = "Gesture" };
DataGridViewTextBoxColumn TextColumn = new System.Windows.Forms.DataGridViewTextBoxColumn() { HeaderText = "Name" };
tutorialGridView.Columns.Add(ImageColumn);
tutorialGridView.Columns.Add(TextColumn);
}
for (int i = 0; i < imagePaths.Length / 3; i++)
{
// Read in three images. Add to row.
FileStream fs1 = File.OpenRead(imagePaths[i * 3]);
byte[] by1 = new byte[fs1.Length];
fs1.Read(by1, 0, by1.Length);
String name1 = System.IO.Path.GetFileNameWithoutExtension(imagePaths[i * 3]);
FileStream fs2 = File.OpenRead(imagePaths[i * 3 + 1]);
byte[] by2 = new byte[fs2.Length];
fs2.Read(by2, 0, by2.Length);
String name2 = System.IO.Path.GetFileNameWithoutExtension(imagePaths[i * 3 + 1]);
FileStream fs3 = File.OpenRead(imagePaths[i * 3 + 2]);
byte[] by3 = new byte[fs3.Length];
fs3.Read(by3, 0, by3.Length);
String name3 = System.IO.Path.GetFileNameWithoutExtension(imagePaths[i * 3 + 2]);
tutorialGridView.Rows.Add(by1, name1, by2, name2, by3, name3);
}
}
开发者ID:lichiconstant,项目名称:KinectCapstone,代码行数:32,代码来源:MainWindow.cs
示例2: datagird_style
public void datagird_style()
{
try
{
theater_search.Columns[0].HeaderText = "Theater Name";
theater_search.Columns[1].HeaderText = "Screen Name";
theater_search.Columns[2].HeaderText = "Location";
theater_search.Columns[3].HeaderText = "City";
theater_search.Columns[4].HeaderText = "Status";
if (!theater_search.Columns.Contains("edit"))
{
DataGridViewImageColumn edit = new DataGridViewImageColumn();
DataGridViewImageColumn delete = new DataGridViewImageColumn();
Image image = Image.FromFile(@"E:\Current Working\E-booking\Eticket_picx\delete.PNG");
Image image1 = Image.FromFile(@"E:\Current Working\E-booking\Eticket_picx\edit.PNG");
delete.Image = image;
edit.Image = image1;
//button.DefaultCellStyle
theater_search.Columns.Add(edit);
theater_search.Columns.Add(delete);
theater_search.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
theater_search.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
theater_search.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
theater_search.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
theater_search.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
theater_search.Columns[theater_search.Columns.Count-2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
theater_search.Columns[theater_search.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
}
}
catch { }
}
开发者ID:Aneetha,项目名称:Test,代码行数:34,代码来源:Main.cs
示例3: frmArqueoCaja
public frmArqueoCaja(DateTimePicker dtPicker)
{
InitializeComponent();
Cursor.Current = Cursors.WaitCursor;
this.dtPicker = dtPicker;
DataGridViewImageColumn imageColumn2 = new DataGridViewImageColumn();
Image image2 = global::StockVentas.Properties.Resources.document_edit;
imageColumn2.Image = image2;
imageColumn2.Name = "Editar";
dgvTesoreria.Columns.Add(imageColumn2);
DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
Image image = global::StockVentas.Properties.Resources.delete16;
imageColumn.Image = image;
imageColumn.Name = "Borrar";
dgvTesoreria.Columns.Add(imageColumn);
dgvTesoreria.CellClick += new DataGridViewCellEventHandler(dgvTesoreria_CellClick);
DataGridViewImageColumn imageColumn3 = new DataGridViewImageColumn();
imageColumn3.Image = image2;
imageColumn3.Name = "Editar";
dgvVentas.Columns.Add(imageColumn3);
DataGridViewImageColumn imageColumn4 = new DataGridViewImageColumn();
imageColumn4.Image = image;
imageColumn4.Name = "Borrar";
dgvVentas.Columns.Add(imageColumn4);
dgvVentas.CellClick += new DataGridViewCellEventHandler(dgvVentas_CellClick);
tblArticulos = BL.ArticulosBLL.CrearDataset();
}
开发者ID:BenjaOtero,项目名称:trend-pos-factura,代码行数:27,代码来源:frmArqueoCaja.cs
示例4: frmArqueoCajaAdmin
public frmArqueoCajaAdmin(DataSet dsArqueo, DateTime fecha, int idLocal, string nombreLocal, int idPc)
{
InitializeComponent();
frmInstanciaArqueo = this;
this.dt = dsArqueo;
this.fecha = fecha;
this.idLocal = idLocal;
this.nombreLocal = nombreLocal;
this.idPc = idPc;
Cursor.Current = Cursors.WaitCursor;
DataGridViewImageColumn imageColumn2 = new DataGridViewImageColumn();
Image image2 = global::StockVentas.Properties.Resources.document_edit;
imageColumn2.Image = image2;
imageColumn2.Name = "Editar";
dgvTesoreria.Columns.Add(imageColumn2);
DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
Image image = global::StockVentas.Properties.Resources.delete16;
imageColumn.Image = image;
imageColumn.Name = "Borrar";
dgvTesoreria.Columns.Add(imageColumn);
dgvTesoreria.CellClick += new DataGridViewCellEventHandler(dgvTesoreria_CellClick);
DataGridViewImageColumn imageColumn3 = new DataGridViewImageColumn();
imageColumn3.Image = image2;
imageColumn3.Name = "Editar";
dgvVentas.Columns.Add(imageColumn3);
DataGridViewImageColumn imageColumn4 = new DataGridViewImageColumn();
imageColumn4.Image = image;
imageColumn4.Name = "Borrar";
dgvVentas.Columns.Add(imageColumn4);
dgvVentas.CellClick += new DataGridViewCellEventHandler(dgvVentas_CellClick);
tblArticulos = BL.GetDataBLL.Articulos();
OrganizarTablas();
CargarDatos();
}
开发者ID:BenjaOtero,项目名称:trend-gestion-desktop,代码行数:34,代码来源:frmArqueoCajaAdmin.cs
示例5: Grille
public Grille()
{
InitializeComponent();
this.grilleData.AutoGenerateColumns = false; //Les colonnes sont créées manuellement
grilleData.Columns.Insert(0, this.createSimpleColumn("Ref"));
grilleData.Columns.Insert(1, this.createSimpleColumn("Contexte"));
grilleData.Columns.Insert(2, this.createSimpleColumn("Sujet"));
grilleData.Columns.Insert(3, this.createSimpleColumn("Titre"));
grilleData.Columns["Titre"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
// Création de la colonne des liens
DataGridViewImageColumn linkCol = new DataGridViewImageColumn();
linkCol.Name = "Liens";
linkCol.DataPropertyName = "Liens";
grilleData.Columns.Insert(4, linkCol);
grilleData.Columns.Insert(5, this.createSimpleColumn("Deadline"));
grilleData.Columns.Insert(6, this.createSimpleColumn("Destinataire"));
grilleData.Columns.Insert(7, this.createSimpleColumn("Statut"));
this.grilleData.DataSource = new DataTable();
// On rajoute les lignes qu'il faut dans le contextMenu de la liste d'actions
NameValueCollection section = (NameValueCollection)ConfigurationManager.GetSection("Export");
// Affichage de l'item dans le menu uniquement si une valeur d'export
this.exportMenuItem.Visible = (section.Count > 0);
foreach (string key in section)
this.exportMenuItem.DropDown.Items.Add(key, null, this.exportRow);
((ToolStripDropDownMenu)exportMenuItem.DropDown).ShowImageMargin = false;
}
开发者ID:tanguy2m,项目名称:TaskLeader,代码行数:33,代码来源:Grille.cs
示例6: UnboundImage_Load
private void UnboundImage_Load(object sender, EventArgs e)
{
genericImage = imageList.Images[1];
newImage = imageList.Images[0];
// Bind the grid.
dataGridView1.DataSource = Program.StoreDB.GetProducts();
// Create the image column.
DataGridViewImageColumn imageCol = new DataGridViewImageColumn();
imageCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
imageCol.ImageLayout = DataGridViewImageCellLayout.Normal;
imageCol.Frozen = true;
imageCol.Name = "Image";
imageCol.HeaderText = "";
// Move the column to the left, and move the ProductID
// column out of the way.
imageCol.DisplayIndex = 0;
dataGridView1.Columns["ProductID"].DisplayIndex = 1;
// By default, show the generic image.
imageCol.Image = genericImage;
// Add the image column to the grid.
dataGridView1.Columns.Add(imageCol);
}
开发者ID:ehershey,项目名称:development,代码行数:28,代码来源:UnboundImage.cs
示例7: adviserForm_Load
//onload fill datagrid
private void adviserForm_Load(object sender, EventArgs e)
{
DataGridViewColumn column = new DataGridViewTextBoxColumn();
// Initialize and add a check box column.
column = new DataGridViewImageColumn();
// column.Image
column.DataPropertyName = "pictureArrByte";
column.Width = 80;
column.Name = "picture";
column.ReadOnly = false;
dataGridView.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "playerId";
column.Name = "Id";
dataGridView.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "firstName";
column.Name = "First Name";
dataGridView.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "lastName";
column.Name = "Last Name";
dataGridView.Columns.Add(column);
// Initialize and add a check box column.
DataGridViewCheckBoxColumn columnCheckBox = new DataGridViewCheckBoxColumn();
columnCheckBox.DataPropertyName = "Action";
columnCheckBox.Name = "Action";
columnCheckBox.ReadOnly = false;
dataGridView.Columns.Add(columnCheckBox);
//Fill data to form
Players[] list = server.getAdvisors(playerId);
dataGridView.AutoGenerateColumns = false;
dataGridView.AutoSize = false;
foreach (Players player in list)
{
if (player.pictureArrByte != null)
{
Rectangle compressionRectangle = new Rectangle(60, 60,
player.pictureArrByte.Width / 2, player.pictureArrByte.Height / 2);
using (Graphics g = Graphics.FromImage(player.pictureArrByte))
g.DrawImage(player.pictureArrByte, compressionRectangle);
}
}
dataGridView.DataSource = list;
//set the heigt for picture colum
foreach (DataGridViewRow row in dataGridView.Rows)
{
row.Height = 75;
}
}
开发者ID:MatanShulman,项目名称:TiacTacToe,代码行数:61,代码来源:adviserForm.cs
示例8: FormFtpClient
public FormFtpClient()
{
InitializeComponent();
// title bar
this.Text = Application.ProductName + " " + Application.ProductVersion;
// setup grid
DataGridViewImageColumn ic = new DataGridViewImageColumn( false );
ic.Name = "Type";
gridItems.Columns.Add( ic );
gridItems.Columns.Add( "Name", "Name" );
gridItems.Columns.Add( "Size", "Size" );
gridItems.Columns.Add( "Date", "Date" );
gridItems.Columns["Type"].Width = 34;
gridItems.Columns["Name"].Width = 200;
gridItems.Columns["Size"].Width = 100;
gridItems.Columns["Size"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
gridItems.Columns["Date"].Width = 120;
// update
UpdateUi();
}
开发者ID:ontytoom,项目名称:AntonFtpClient,代码行数:25,代码来源:FormFtpClient.cs
示例9: AddMeasure
public AddMeasure()
{
InitializeComponent();
string dbPath = Path.Combine(
Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location),
Properties.Settings.Default.DbName);
this.engine = new SQLiteDBEngine(dbPath);
// Облачность
cbCloud.DataSource = engine.AddBlankRow(engine.ExecuteQueryReturnDataTable(new SQLiteCommand("SELECT ID, Name FROM cloud")));
cbCloud.DisplayMember = "Name";
cbCloud.ValueMember = "ID";
// Ветер
cbWind.DataSource = engine.AddBlankRow(engine.ExecuteQueryReturnDataTable(new SQLiteCommand("SELECT ID, Name FROM wind")));
cbWind.DisplayMember = "Name";
cbWind.ValueMember = "ID";
// Сила ветра
cbWindForce.DataSource = engine.AddBlankRow(engine.ExecuteQueryReturnDataTable(new SQLiteCommand("SELECT ID, Name FROM windForce")));
cbWindForce.DisplayMember = "Name";
cbWindForce.ValueMember = "ID";
// Осадки
cbFallouts.DataSource = engine.ExecuteQueryReturnDataTable(new SQLiteCommand("SELECT ID, Name, IconPath FROM fallout"));
cbFallouts.DisplayMember = "Name";
cbFallouts.ValueMember = "ID";
cbFallouts.DropDownStyle = ComboBoxStyle.DropDownList;
btnAddFallout.Click += btnAddFallout_Click;
btnDelFallout.Click += btnDelFallout_Click;
// Осадки
dgvFallouts.ReadOnly = true;
dgvFallouts.RowHeadersVisible = false;
dgvFallouts.ColumnHeadersVisible = false;
dgvFallouts.AutoGenerateColumns = false;
dgvFallouts.AllowUserToAddRows = false;
dgvFallouts.CellBorderStyle = DataGridViewCellBorderStyle.None;
dgvFallouts.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgvFallouts.RowTemplate.Height = 36;
// Precipitation table
var flColumn = new DataGridViewTextBoxColumn();
flColumn.DataPropertyName = "Name";
flColumn.Name = "Name";
flColumn.HeaderText = "Имя";
flColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dgvFallouts.Columns.Add(flColumn);
var flIconColumn = new DataGridViewImageColumn();
flIconColumn.DataPropertyName = "FalloutIcon";
flIconColumn.Name = "FalloutIcon";
flIconColumn.HeaderText = "Иконка";
flIconColumn.Width = 36;
dgvFallouts.Columns.Add(flIconColumn);
errorProvider = new ErrorProvider();
tbTemperature.Validating += new CancelEventHandler(tbTemperature_Validating);
dgvFallouts.DataSource = this.engine.ExecuteQueryReturnDataTable(new SQLiteCommand("SELECT fs.ID, fs.Measure_ID, fs.Fallout_ID, f.Name, f.IconPath, NULL AS FalloutIcon FROM fallouts fs INNER JOIN fallout f ON fs.Fallout_ID = f.ID WHERE fs.Measure_ID IS NULL"));
dgvFallouts.RowsAdded += new DataGridViewRowsAddedEventHandler(dgvFallouts_RowsAdded);
}
开发者ID:roxocode,项目名称:wether_diary,代码行数:59,代码来源:AddMeasure.cs
示例10: configForm
private void configForm()
{
this.Text = Constantes.APP_NAME + " : Historique Approvisionnement";
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
iconColumn.Name = "mouv";
iconColumn.HeaderText = "";
dgv_approvision.Columns.Insert(3, iconColumn);
}
开发者ID:dowesw,项目名称:GESTION_CAISSE,代码行数:8,代码来源:Form_Approvision.cs
示例11: AddColumnsProgrammatically
private void AddColumnsProgrammatically()
{
var col0 = new DataGridViewTextBoxColumn();
var col1 = new DataGridViewTextBoxColumn();
var col1a = new DataGridViewTextBoxColumn();
var col2 = new DataGridViewTextBoxColumn();
var col2a = new DataGridViewTextBoxColumn();
var col3 = new DataGridViewTextBoxColumn();
var col4 = new DataGridViewTextBoxColumn();
col0.HeaderText = "Id";
col0.Name = "Id";
col0.ReadOnly = true;
col0.Visible = false;
col1.HeaderText = "User";
col1.Name = "User_Id";
col1.ReadOnly = true;
col1.Visible = false;
col1a.HeaderText = "Name";
col1a.Name = "Name";
col1a.ReadOnly = true;
col2.HeaderText = "Message";
col2.Name = "Message";
//col2.Width = 300;
col2.ReadOnly = true;
col2a.HeaderText = "Countdown";
col2a.Name = "countdown_ind";
col2a.ReadOnly = true;
col2a.Visible = false;
col3.HeaderText = "End Date";
col3.Name = "End_Date";
col3.ReadOnly = true;
col4.HeaderText = "Repeat";
col4.Name = "Repeat_Ind";
col4.ReadOnly = true;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { col0, col1, col1a, col2, col2a, col3, col4 });
DataGridViewImageColumn img_delete = new DataGridViewImageColumn();
dataGridView1.Columns.Add(img_delete);
img_delete.HeaderText = "Delete";
img_delete.Name = "Delete";
img_delete.Image = FruPak.PF.Global.Properties.Resources.delete;
img_delete.ReadOnly = true;
DataGridViewImageColumn img_edit = new DataGridViewImageColumn();
dataGridView1.Columns.Add(img_edit);
img_edit.HeaderText = "Edit";
img_edit.Name = "Edit";
img_edit.Image = FruPak.PF.Global.Properties.Resources.edit;
img_edit.ReadOnly = true;
}
开发者ID:BruceNielsen,项目名称:_V4.7-Proxy,代码行数:58,代码来源:Fun_Messages.cs
示例12: JpegViewer
public JpegViewer(string[] _jpgFiles, string jpgFile = "")
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;//Maximize form
#region initialize dgv
//Add ImageColumn
DataGridViewImageColumn imgColumn = new DataGridViewImageColumn();
imgColumn.Name = "Image";
imgColumn.ImageLayout = DataGridViewImageCellLayout.Zoom;//イメージを縦横の比率を維持して拡大、縮小表示する
imgColumn.Description = "イメージ"; //イメージの説明。セルをクリップボードにコピーした時に使用される
dgv.Columns.Add(imgColumn);//DataGridViewに追加する
dgv.Columns["Image"].Width = 120;
dgv.RowTemplate.Height = 90;
//Add CheckBoxColumn
DataGridViewCheckBoxColumn cbColumn = new DataGridViewCheckBoxColumn();
cbColumn.Name = "cbColumn";
dgv.Columns.Add(cbColumn);
cbColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
//Add TextBoxColumn
DataGridViewTextBoxColumn tbColumn = new DataGridViewTextBoxColumn();
tbColumn.Name = "tbColumn";
tbColumn.ReadOnly = true;
dgv.Columns.Add(tbColumn);
tbColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgv.RowHeadersVisible = false;//Make selector invisible
dgv.ColumnHeadersVisible = false;//Make column header invisible
dgv.AllowUserToAddRows = false;
dgv.AllowUserToResizeColumns = false;
dgv.AllowUserToResizeRows = false;
#endregion
#region dgv image procedure
jpgFiles.AddRange(_jpgFiles);
jpgFiles.Sort();
for (int i = 0; i < jpgFiles.Count; i++)
{
try
{
dgv.Rows.Add();
dgv["Image", i].Value = new Bitmap(jpgFiles[i].ToString());
}
catch (ArgumentOutOfRangeException)
{ MessageBox.Show("[ArgumentOutOfRangeException]" + Properties.Resources.HasOccurred, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
}
#endregion
#region pictureBox
pbMain.SizeMode = PictureBoxSizeMode.Zoom;
selectedJpgFile = jpgFile;
#endregion
}
开发者ID:KoichiHirahata,项目名称:PtGraViewer,代码行数:57,代码来源:JpegViewer.cs
示例13: ImageTest
public void ImageTest ()
{
SWF.DataGridViewImageColumn column = new SWF.DataGridViewImageColumn ();
column.HeaderText = "Image Column";
ColumnCellTest (column,
new SWF.DataGridViewImageCell (),
false,
new SWF.DataGridViewImageCell ());
}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:DataGridViewProviderTest.cs
示例14: frmEmpleadosMovCons
public frmEmpleadosMovCons(DataTable tblEmpleadosMov)
{
InitializeComponent();
this.tblEmpleadosMov = tblEmpleadosMov;
DataGridViewImageColumn imageColumn2 = new DataGridViewImageColumn();
Image image2 = global::StockVentas.Properties.Resources.document_edit;
imageColumn2.Image = image2;
imageColumn2.Name = "Editar";
dgvEmpleados.Columns.Add(imageColumn2);
}
开发者ID:BenjaOtero,项目名称:trend-gestion-desktop,代码行数:10,代码来源:frmEmpleadosMovCons.cs
示例15: createDgvImageColumn
public static DataGridViewImageColumn createDgvImageColumn(String dataPropertyName, String headerText, int width, bool visible)
{
DataGridViewImageColumn column = new DataGridViewImageColumn();
column.DataPropertyName = dataPropertyName;
column.HeaderText = headerText;
column.Width = width;
column.ImageLayout = DataGridViewImageCellLayout.Normal;
column.Visible = visible;
return column;
}
开发者ID:Richmandos,项目名称:ebaymaster,代码行数:10,代码来源:DgvUtil.cs
示例16: Items
public Items(AionData data)
{
InitializeComponent();
Thread t = new Thread(() => {
XDocument doc = AionData.BXMLToXML(data.ReadXMLFile(@"Data\Items\Items.pak", "client_items.xml"));
Dictionary<string, int> columns = new Dictionary<string, int>();
BeginInvoke(new Action(() => {
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
iconColumn.Name = "icon";
iconColumn.HeaderText = "icon";
dataGridView1.Columns.Add(iconColumn);
foreach (var node in doc.Elements().First().Elements().First().Elements()) {
dataGridView1.Columns.Add(node.Name.LocalName, node.Name.LocalName);
columns[node.Name.LocalName] = columns.Count;
}
}));
foreach (var node in doc.Elements().First().Elements()) {
BeginInvoke(new Action<XElement>(x => {
string[] values = new string[columns.Count];
foreach (XElement val in x.Elements()) {
if (!columns.ContainsKey(val.Name.LocalName)) {
dataGridView1.Columns.Add(val.Name.LocalName, val.Name.LocalName);
columns[val.Name.LocalName] = columns.Count;
Array.Resize(ref values, columns.Count);
}
values[columns[val.Name.LocalName]] = (val.Value);
}
var iconname = values[columns["icon_name"]];
Bitmap b = data.ReadDDSFile(@"Data\Items\Items.pak", iconname + ".dds");
object[] rowValues = new object[] { b }.Concat(values).ToArray();
int rowIndex = dataGridView1.Rows.Add(rowValues);
dataGridView1.Rows[rowIndex].Height = 64;
}), node);
Thread.Sleep(10);
if (dataGridView1.Rows.Count > 10000) {
return;
}
}
});
t.IsBackground = true;
t.Priority = ThreadPriority.Lowest;
t.Start();
}
开发者ID:davidsiaw,项目名称:aiondb,代码行数:55,代码来源:Items.cs
示例17: btnQuery_Click
private void btnQuery_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
this.dgErrorCode.Rows.Clear();
dgErrorCode.Columns.Clear();
dgErrorCode.Columns.Add("序号", "序号");
dgErrorCode.Columns.Add("子系统", "子系统");
dgErrorCode.Columns.Add("报错关键字", "报错关键字");
dgErrorCode.Columns.Add("报错描述", "报错描述");
DataGridViewImageColumn column = new DataGridViewImageColumn();
column.HeaderText = "出错截图信息";
column.Name = "Image";
//column.Image =System.Drawing.Image.FromFile( "./TestError.png");
dgErrorCode.Columns.Add(column);
//dgErrorCode.Columns.Add("出错截图信息", "出错截图信息");
dgErrorCode.Columns.Add("原因及处理方法", "原因及处理方法");
dgErrorCode.Columns.Add("联系方式", "联系方式");
// dgErrorCode.Columns.Add("备注", "备注");
dgErrorCode.Columns.Add("查询次数", "查询次数");
AgentErrorCodeDao agentErrorCodeDao = new AgentErrorCodeDao();
IList<AgentErrorCode> ErrorCodeList = agentErrorCodeDao.GetList(this.txtErrorCode.Text.Trim());
if (ErrorCodeList != null && ErrorCodeList.Count > 0)
{
for (int i = 0; i < ErrorCodeList.Count; i++)
{
dgErrorCode.Rows.Add();
DataGridViewRow row = dgErrorCode.Rows[i];
row.Cells[0].Value = (i + 1).ToString();
row.Cells[1].Value = ErrorCodeList[i].module;
row.Cells[2].Value = ErrorCodeList[i].keyword;
row.Cells[3].Value = ErrorCodeList[i].errorDesc;
row.Cells[4].Value = ErrorCodeList[i].errorImg;
row.Cells[5].Value = ErrorCodeList[i].solution;
row.Cells[6].Value = ErrorCodeList[i].contactName;
row.Cells[7].Value = ErrorCodeList[i].queryCount;
}
this.dgErrorCode.AutoResizeColumns();
this.dgErrorCode.AutoResizeRows();
//dgErrorCode.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True;
}
this.Cursor = Cursors.Default;
}
开发者ID:ZhouAnPing,项目名称:Mail,代码行数:53,代码来源:frmErrorCodeQuery.cs
示例18: champanshipForm_Load
//on load fill datagrid
private void champanshipForm_Load(object sender, EventArgs e)
{
DataGridViewColumn column = new DataGridViewTextBoxColumn();
column = new DataGridViewImageColumn();
// column.Image
column.DataPropertyName = "picture";
column.Width = 80;
column.Name = "picture";
column.ReadOnly = false;
dataGridViewChamp.Columns.Add(column);
// Initialize and add a text box column.
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Id";
column.Name = "Id";
dataGridViewChamp.Columns.Add(column);
// Initialize and add a check box column.
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Name";
column.Name = "Name";
dataGridViewChamp.Columns.Add(column);
// Initialize and add a check box column.
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Location";
column.Name = "Location";
dataGridViewChamp.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Date";
column.Name = "Date";
dataGridViewChamp.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Registered";
column.Name = "Registered";
column.DefaultCellStyle.NullValue = "No";
dataGridViewChamp.Columns.Add(column);
// Initialize and add a check box column.
DataGridViewCheckBoxColumn columnCheckBox = new DataGridViewCheckBoxColumn();
columnCheckBox.DataPropertyName = "Action";
columnCheckBox.Name = "Action";
columnCheckBox.ReadOnly = false;
dataGridViewChamp.Columns.Add(columnCheckBox);
fillDataGrid();
}
开发者ID:MatanShulman,项目名称:TiacTacToe,代码行数:51,代码来源:champanshipForm.cs
示例19: CustomerEditorForm
public CustomerEditorForm(Space.RouteType routeType)
{
InitializeComponent();
dgvMinHeight = dgvGeneral.Height;
dgvMinWidth = dgvGeneral.Width;
txtMinWidth = txtInput.Width;
btnAddHeighLoc = btnNewProduct.Location.Y;
this.Text = "เดชาพาณิชย์ - ข้อมูลลูกค้า";
this.routeType = routeType;
DataGridViewImageColumn editColumn = new DataGridViewImageColumn();
editColumn.Image = Image.FromFile("edit-icon.png");
editColumn.HeaderText = "";
editColumn.Name = "Edit";
dgvGeneral.Columns.Add(editColumn);
DataGridViewImageColumn deleteColumn = new DataGridViewImageColumn();
deleteColumn.Image = Image.FromFile("delete-icon.png");
deleteColumn.HeaderText = "";
deleteColumn.Name = "Delete";
dgvGeneral.Columns.Add(deleteColumn);
DataGridViewImageColumn orderUpColumn = new DataGridViewImageColumn();
orderUpColumn.Image = Image.FromFile("arrow_up.png");
orderUpColumn.HeaderText = "";
orderUpColumn.Name = "Up";
dgvGeneral.Columns.Add(orderUpColumn);
DataGridViewImageColumn orderDownColumn = new DataGridViewImageColumn();
orderDownColumn.Image = Image.FromFile("arrow_down.png");
orderDownColumn.HeaderText = "";
orderDownColumn.Name = "Down";
dgvGeneral.Columns.Add(orderDownColumn);
dgvGeneral.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dgvGeneral.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.Columns[7].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvGeneral.RowTemplate.Height = 30;
dgvGeneral.RowHeadersVisible = false;
customerList = Space.GetCustomersByRoute(routeType);
ListAllCustomers();
}
开发者ID:beirbear,项目名称:PrivateDCP,代码行数:50,代码来源:CustomerEditorForm.cs
示例20: Setup
public void Setup()
{
//Create Columns
dataGridView.ColumnCount = 3;
dataGridView.Columns[0].Name = "Marble Color";
dataGridView.Columns[1].Name = "Output";
dataGridView.Columns[2].Name = "Status";
DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
imageColumn.Image = PSSC.App.Properties.Resources.SymbolCheck1;
dataGridView.Columns.Insert(0, imageColumn);
//Set Color, Font, Size for Columns Header
dataGridView.EnableHeadersVisualStyles = false;
dataGridView.Columns[0].Width = 50;
}
开发者ID:haltt051093,项目名称:IMS-datacenter,代码行数:15,代码来源:DgvOutputMarblesHelper.cs
注:本文中的System.Windows.Forms.DataGridViewImageColumn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论