• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.DataGridViewTextBoxCell类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.DataGridViewTextBoxCell的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewTextBoxCell类的具体用法?C# DataGridViewTextBoxCell怎么用?C# DataGridViewTextBoxCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataGridViewTextBoxCell类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewTextBoxCell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BindToDgv

        void BindToDgv(INewsBase news, int typeID, int pageIndex = 1)
        {
            dgv.Rows.Clear();
            if (news != null)
            {
                var newsList = news.GetNewsList(typeID, pageIndex);
                if (newsList == null || newsList.Count <= 0) return;
                foreach (var item in newsList)
                {
                    int index = dgv.Rows.Add();
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.Value = item.ID;
                    dgv.Rows[index].Cells["ID"] = cell;

                    cell = new DataGridViewTextBoxCell();
                    cell.Value = item.Title;
                    dgv.Rows[index].Cells["Title"] = cell;

                    cell = new DataGridViewTextBoxCell();
                    cell.Value = item.Source;
                    dgv.Rows[index].Cells["Source"] = cell;

                    DataGridViewButtonCell cellb = new DataGridViewButtonCell();
                    cellb.Value = item.IsGetted ? "تامام" : "يىغىش";
                    dgv.Rows[index].Cells["Make"] = cellb;

                    dgv.Rows[index].Tag = item;
                    if (item.IsGetted)
                    {
                        dgv.Rows[index].DefaultCellStyle = new DataGridViewCellStyle() { ForeColor = Color.Gray };
                    }
                }
            }
        }
开发者ID:abduwaris,项目名称:NewsGet,代码行数:34,代码来源:FrmHome.cs


示例2: btnAddProduct_Click

        private void btnAddProduct_Click(object sender, EventArgs e)
        {
            var af = new AddProductForm();
            if (af.ShowDialog() == DialogResult.OK)
            {
                Product prod=af.Product;

                DataGridViewCell cel0 = new DataGridViewTextBoxCell();
                cel0.Value = prod.Name;

                DataGridViewCell cel1 = new DataGridViewTextBoxCell();
                cel1.Value = prod.AlbumName;

                DataGridViewCell cel2 = new DataGridViewTextBoxCell();
                cel2.Value = prod.Photos.Count;

                DataGridViewRow row = new DataGridViewRow();
                row.Cells.AddRange(cel0, cel1, cel2);

                grid.Rows.Add(row);

                Products.Add(prod);

                btnStart.Enabled = true;
            }
        }
开发者ID:Infarch,项目名称:MyPerlModules,代码行数:26,代码来源:Form1.cs


示例3: TableForm

        public TableForm(string name, IDataReader rdr)
        {
            DataGridView dgv = new DataGridView();
            dgv.Dock = DockStyle.Fill;
            DataGridViewTextBoxCell template = new DataGridViewTextBoxCell();
            template.Style.Font = new Font("DejaVu Sans",10);
            for (int i = 0;i < rdr.FieldCount;i++)
            {
                DataGridViewColumn col = new DataGridViewColumn(template);
                col.Name = rdr.GetName(i);
                dgv.Columns.Add(col);
            }
            while (rdr.Read())
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(dgv);
                for (int i = 0;i < rdr.FieldCount;i++)
                {
                    object val = rdr[i];
                    if (val is byte[])
                    {
                        val = Encoding.UTF8.GetString((byte[])val);
                    }
                    row.Cells[i].Value = val;
                }
                dgv.Rows.Add(row);
            }

            Controls.Add(dgv);
        }
开发者ID:Upliner,项目名称:XFormTrans,代码行数:30,代码来源:TableForm.cs


示例4: InitialDataGridView

        public void InitialDataGridView()
        {
            dataGridView.Rows.Clear();
            dataGridView.Columns.Clear();

            DataGridViewCell textCell = new DataGridViewTextBoxCell();
            DataGridViewColumn timeColumn = new DataGridViewColumn();
            timeColumn.HeaderText = "记录时间";
            timeColumn.Width = 160;
            timeColumn.CellTemplate = textCell;
            DataGridViewColumn ipColumn = new DataGridViewColumn();
            ipColumn.HeaderText = "IP地址";
            ipColumn.Width = 120;
            ipColumn.CellTemplate = textCell;
            DataGridViewColumn portColumn = new DataGridViewColumn();
            portColumn.HeaderText = "端口号";
            portColumn.Width = 80;
            portColumn.CellTemplate = textCell;
            DataGridViewColumn statusColumn = new DataGridViewColumn();
            statusColumn.HeaderText = "工作状态";
            statusColumn.Width = 180;
            statusColumn.CellTemplate = textCell;
            dataGridView.Columns.Add(timeColumn);
            dataGridView.Columns.Add(ipColumn);
            dataGridView.Columns.Add(portColumn);
            dataGridView.Columns.Add(statusColumn);
        }
开发者ID:southpolaris,项目名称:EMDRepository,代码行数:27,代码来源:ConnectionForm.cs


示例5: CargarTabla

        public void CargarTabla()
        {
            // Format DataGridView
            
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.BackgroundColor = this.BackColor;

            this.dataGridView1.RowHeadersWidth = 75;
            
            String [] Semana = {"Lunes", 
                                "Martes", 
                                "Miercoles", 
                                "Jueves", 
                                "Viernes", 
                                "Sabado"
                               };

            // Add columns to DataGridView

            foreach (String item in Semana)
            {
                DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();
                checkColumn.Name = "Columna_" + item;
                checkColumn.HeaderText = item;
                checkColumn.Width = 75;
                checkColumn.ReadOnly = true;
                checkColumn.FillWeight = 10; //if the datagridview is resized (on form resize) the checkbox won't take up too much; value is relative to the other columns' fill values
                dataGridView1.Columns.Add(checkColumn);
            }

            // Add rows to DataGridView
            for (int i = 7; i <= 32; i++)
            {
                TimeSpan t = TimeSpan.FromSeconds(25200 + ((i - 7)* 1800));
                dataGridView1.Rows.Add();
                dataGridView1.Rows[i - 7].HeaderCell.Value = t.ToString().Substring(0, 5) ;
            }

            // Sabados no se trabaja hasta las 10
            for (int i = 0; i < 6; i++)
            {
                DataGridViewTextBoxCell TextBoxCell = new DataGridViewTextBoxCell();
                dataGridView1[5, i] = TextBoxCell;
                dataGridView1[5, i].Value = "";
                dataGridView1[5, i].Style.BackColor = Color.Black;
                dataGridView1[5, i].ReadOnly = true;
            }

            // Sabados no se trabaja desde las 5
            for (int i = 16; i <= 25; i++)
            {
                DataGridViewTextBoxCell TextBoxCell = new DataGridViewTextBoxCell();
                dataGridView1[5, i] = TextBoxCell;
                dataGridView1[5, i].Value = "";
                dataGridView1[5, i].Style.BackColor = Color.Black;
                dataGridView1[5, i].ReadOnly = true;
                
            }
            
        }
开发者ID:ccantero,项目名称:gdatos_EnerLand,代码行数:60,代码来源:RegistrarAgendaForm.cs


示例6: data_grid

        public static void data_grid(DataGridView dgv_grid)
        {
            dgv_grid.AutoGenerateColumns = true;

            DataGridViewCell Cell_1 = new DataGridViewTextBoxCell();
            DataGridViewCell Cell_2 = new DataGridViewTextBoxCell();
            DataGridViewCell Cell_3 = new DataGridViewTextBoxCell();

            DataGridViewColumn col__from   = new DataGridViewColumn();
            DataGridViewColumn col__to     = new DataGridViewColumn();
            DataGridViewColumn col__length = new DataGridViewColumn();

            col__from.HeaderText   = "Откуда";
            col__to.HeaderText     = "Куда";
            col__length.HeaderText = "Длина";

            col__from.Width   = 110;
            col__to.Width     = 110;
            col__length.Width = 110;

            col__from.CellTemplate   = Cell_1;
            col__to.CellTemplate     = Cell_2;
            col__length.CellTemplate = Cell_3;

            dgv_grid.ReadOnly = false;
            dgv_grid.AllowUserToAddRows = true;
            dgv_grid.AllowUserToDeleteRows = true;
            dgv_grid.Columns.Add(col__from);
            dgv_grid.Columns.Add(col__to);
            dgv_grid.Columns.Add(col__length);
        }
开发者ID:Zarettiii,项目名称:ant_algorithm,代码行数:31,代码来源:c__data_grids.cs


示例7: addDirectory

        /// <summary>
        /// Recursively goes through all files in the directory 
        /// and adds them to the MyFilesDB
        /// </summary>
        /// <param name="directory">Current Directory To Search</param>
        private void addDirectory(String directory)
        {
            try
            {
                foreach (String file in Directory.GetFiles(directory))
                {
                    myFilesDb.AddFile(file);
                    DataGridViewRow row = new DataGridViewRow();
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.Value = "Hashed: " + file;
                    row.Cells.Add(cell);
                    if (isShown && !gvLog.IsDisposed && !this.IsDisposed)
                    {
                        try
                        {
                            this.Invoke(new MethodInvoker(
                                    delegate()
                                    {
                                        gvLog.Rows.Insert(0, row);
                                    }));
                        }
                        catch { isShown = false; }
                    }

                }
            }
            catch { }

            foreach (String nextDir in Directory.GetDirectories(directory))
            {
                addDirectory(nextDir);
            }
        }
开发者ID:TheProjecter,项目名称:serverless-fileshare,代码行数:38,代码来源:AddFilesToShare.cs


示例8: DisplayConfigs

        public void DisplayConfigs()
        {
            ConfigList.Rows.Clear();

            foreach (ConfigSet config in Configs)
            {
                DataGridViewRow row = new DataGridViewRow();
                DataGridViewCell cell = new DataGridViewTextBoxCell();

                if (config.DefaultConfig)
                    cell.Value = @"✔";
                else
                    cell.Value = "";
                row.Cells.Add(cell);

                cell = new DataGridViewTextBoxCell();
                cell.Value = config.Name;
                row.Cells.Add(cell);

                cell = new DataGridViewTextBoxCell();
                cell.Value = config.BitSize.ToString();
                row.Cells.Add(cell);

                cell = new DataGridViewTextBoxCell();
                cell.Value = config.ConfigPath;
                row.Cells.Add(cell);

                ConfigList.Rows.Add(row);
            }
        }
开发者ID:SteveMoody73,项目名称:Amleto,代码行数:30,代码来源:SetupWin.cs


示例9: updateGrid

        public void updateGrid()
        {
            dataGridView1.Rows.Clear();
            dataGridView1.Columns.Clear();

            //style for classroom name
            DataGridViewCell cellStyle = new DataGridViewTextBoxCell();
            cellStyle.Style.BackColor = Color.Wheat;

            DataGridViewButtonColumn deleteButtonColumn = new DataGridViewButtonColumn();

            deleteButtonColumn.Text = "Delete Classroom";
            deleteButtonColumn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn updateButtonColumn = new DataGridViewButtonColumn();
            updateButtonColumn.Text = "Update Classroom";

            updateButtonColumn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn manageComputersButtonColumn = new DataGridViewButtonColumn();
            manageComputersButtonColumn.Text = "Manage computers";

            manageComputersButtonColumn.UseColumnTextForButtonValue = true;

            dataGridView1.Columns.Add(new DataGridViewColumn(cellStyle));
            dataGridView1.Columns.Add(new DataGridViewCheckBoxColumn());

            dataGridView1.Columns.Add(updateButtonColumn);
            dataGridView1.Columns.Add(manageComputersButtonColumn);
            dataGridView1.Columns.Add(deleteButtonColumn);

            foreach (Classroom classroom in MainProgram.rooms)
                dataGridView1.Rows.Add(classroom.Classroomname,classroom.Projectoravailable);
        }
开发者ID:TheGer,项目名称:Examples,代码行数:34,代码来源:ClassroomsForm.cs


示例10: AddElementToDataGridView

		private void AddElementToDataGridView(Param element)
		{
			var row = new DataGridViewRow();
			
			// пустая сточка означет разделитель между 
			// отдельными интерфейсами
			if(element.ParamName == string.Empty)
			{
				dataGridView1.Rows.Add(row);
				return;	
			}
			
			// добавляем первую ячейку
			var cell1 = new DataGridViewTextBoxCell() 
			{
			    Value = element.ParamName + ":"
			};
			cell1.Style.Font = new Font(dataGridView1.Font, FontStyle.Bold);
			row.Cells.Add(cell1);
			
			// добавляем вторую ячейку
			var cell2 = new DataGridViewTextBoxCell() 
			{
			    Value = element.ParamValue
			};
			row.Cells.Add(cell2);

			// добавляем строчку в dataGridView
			dataGridView1.Rows.Add(row);
		}
开发者ID:nemocaptm,项目名称:Mashine-side,代码行数:30,代码来源:CPU.cs


示例11: filldatagrid

        public void filldatagrid()
        {
            computersDataGrid.Rows.Clear();
            computersDataGrid.Columns.Clear();

            DataGridViewCell cellStyle = new DataGridViewTextBoxCell();
            cellStyle.Style.BackColor = Color.Wheat;

            DataGridViewButtonColumn deleteButtonColumn = new DataGridViewButtonColumn();

            deleteButtonColumn.Text = "Delete Computer";
            deleteButtonColumn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn updateButtonColumn = new DataGridViewButtonColumn();
            updateButtonColumn.Text = "Update Computer";

            updateButtonColumn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn viewComputerButtonColumn = new DataGridViewButtonColumn();
            viewComputerButtonColumn.Text = "View computer details";
            viewComputerButtonColumn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn moveComputerButtonColumn = new DataGridViewButtonColumn();
            moveComputerButtonColumn.Text = "Move computer";
            moveComputerButtonColumn.UseColumnTextForButtonValue = true;

            computersDataGrid.Columns.Add(new DataGridViewColumn(cellStyle));
            computersDataGrid.Columns.Add(updateButtonColumn);
            computersDataGrid.Columns.Add(deleteButtonColumn);
            computersDataGrid.Columns.Add(viewComputerButtonColumn);
            computersDataGrid.Columns.Add(moveComputerButtonColumn);

            foreach (Computer comp in classroom.Computersinclassroom)
                computersDataGrid.Rows.Add(comp.Computername);
        }
开发者ID:TheGer,项目名称:Examples,代码行数:35,代码来源:ManageComputersForm.cs


示例12: AddItems

 private void AddItems(string[] panels, int sections)
 {
     foreach (string panel in panels)
     {
         DataGridViewComboBoxCell reff = new DataGridViewComboBoxCell();
         DataGridViewTextBoxCell txt2A = new DataGridViewTextBoxCell();
         DataGridViewRow dataGridRow = new DataGridViewRow();
         //ComboBox reff = new ComboBox();
         reff.MaxDropDownItems = sections;
         //reff.DataSource =
         txt2A.Value = panel;
         for (int i = 1; i <= sections; i++)
             reff.Items.Add(i);
         try
         {
             dataGridRow.Cells.Add(txt2A);
             dataGridRow.Cells.Add(reff);
             Grid.Rows.Add(dataGridRow);
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message, "Error");
         }
     }
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:25,代码来源:MessageDropDownBox.cs


示例13: AddToList

        void AddToList(CGoodsData pCGoodsData)
        {
            DataGridViewRow r1 = new DataGridViewRow();

            // 상품 시퀀스
            DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell();
            cell_seq.Value = pCGoodsData.Seq_;
            r1.Cells.Add(cell_seq);

            // 상품명
            DataGridViewTextBoxCell cell_GoodsName = new DataGridViewTextBoxCell();
            cell_GoodsName.Value = pCGoodsData.GoodsName_;
            r1.Cells.Add(cell_GoodsName);

            // 옵션명
            DataGridViewTextBoxCell cell_OptionName = new DataGridViewTextBoxCell();
            cell_OptionName.Value = pCGoodsData.OptionName_;
            r1.Cells.Add(cell_OptionName);

            // 채널
            DataGridViewTextBoxCell cell_Channel = new DataGridViewTextBoxCell();
            cell_Channel.Value = pCGoodsData.ChannelName_;
            r1.Cells.Add(cell_Channel);

            dataGridView_GoodsList.Rows.Add(r1);
        }
开发者ID:Youkyungjin,项目名称:Crawler,代码行数:26,代码来源:StateDetailForm.cs


示例14: AddFilesToView

        public void AddFilesToView(string group)
        {
            Package p = packages._packages.Find(Package => Package._name == group);

            this.form.dataGridView1.BeginInvoke((MethodInvoker)delegate()
            {
                foreach (Item i in p._items)
                {
                    DataGridViewCellStyle style = new DataGridViewCellStyle();
                    style.Alignment = DataGridViewContentAlignment.MiddleCenter;

                    DataGridViewRow row = new DataGridViewRow();

                    DataGridViewTextBoxCell filename = new DataGridViewTextBoxCell();
                    filename.Value = i._file;
                    row.Cells.Add(filename);

                    DataGridViewTextBoxCell status = new DataGridViewTextBoxCell();
                    status.Value = "Unknown";
                    status.Style = style;
                    row.Cells.Add(status);

                    DataGridViewProgressCell download = new DataGridViewProgressCell();
                    download.Value = 0;
                    row.Cells.Add(download);

                    i.row = row;

                    this.form.dataGridView1.Rows.Add(row);
                }
            });
        }
开发者ID:msjohansen,项目名称:RavenloftLauncher,代码行数:32,代码来源:WorkManager.cs


示例15: SetMatrix

        /// <summary>
        /// �\���Ώۂ̍s���ݒ肷��D
        /// </summary>
        /// <param name="m"></param>
        public void SetMatrix(KrdLab.Lisys.Matrix m)
        {
            this.DataGridView.Rows.Clear();
            this.DataGridView.Columns.Clear();
            if (m == null)
            {
                return;
            }

            for (int c = 0; c < m.ColumnSize; ++c)
            {
                var gridCol = new DataGridViewColumn();
                gridCol.HeaderText = String.Format("[ , {0}]", c);
                gridCol.ReadOnly = true;
                gridCol.SortMode = DataGridViewColumnSortMode.NotSortable;
                this.DataGridView.Columns.Add(gridCol);
            }

            for (int r = 0; r < m.RowSize; ++r)
            {
                var gridRow = new DataGridViewRow();
                gridRow.HeaderCell.Value = String.Format("[{0}, ]", r);
                gridRow.ReadOnly = true;
                var row = m.Rows[r];
                foreach (var v in row)
                {
                    var cell = new DataGridViewTextBoxCell();
                    cell.Value = v.ToString();
                    gridRow.Cells.Add(cell);
                }
                this.DataGridView.Rows.Add(gridRow);
            }
            this.DataGridView.RowHeadersWidth = 100;
        }
开发者ID:krdlab,项目名称:lisys,代码行数:38,代码来源:MatrixVisualizerForm.cs


示例16: InitGrid

 private void InitGrid(RedComboBox[] comboboxes, RedContext context)
 {
     foreach(RedComboBox cb in comboboxes)
     {
         var row = new DataGridViewRow();
         var c1 = new DataGridViewTextBoxCell();
         c1.Value = cb.Name;
         DataGridViewCell c2;
         if (cb.query.ToLowerInvariant() == "textedit")
         {
             c2 = new DataGridViewTextBoxCell();
             c2.Value = "";
         }
         else
         {
             c2 = new DataGridViewComboBoxCell();
             var t = cb.GetValues(context);
             foreach (DataRow r in t.Rows)
             {
                 (c2 as DataGridViewComboBoxCell).Items.Add(r[0].ToString());
             }
             (c2 as DataGridViewComboBoxCell).Value = (c2 as DataGridViewComboBoxCell).Items[0];
         }
         c2.ReadOnly = false;
         row.Cells.Add(c1);
         row.Cells.Add(c2);
         dataGridView1.Rows.Add(row);
     }
 }
开发者ID:rsemenov,项目名称:FizDb,代码行数:29,代码来源:ViewForm.cs


示例17: ResultTable

        public ResultTable(DataGridView dataView, string[] names)                                 // constructor.  Uses array of names for column/row header labels
        {
            m_dataView = dataView;
            m_results = new Result[m_numberOfSequences, m_numberOfSequences];

            for (int i = 0; i < m_numberOfSequences; ++i)
            {
                DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn();
                column.HeaderText = "seq" + (i+1);
                column.MaxInputLength = 8;
                column.Width = 50;
                DataGridViewCell cell = new DataGridViewTextBoxCell();
                column.CellTemplate = cell;
                m_dataView.Columns.Add(column);
            }
            for (int j = 0; j < m_numberOfSequences; ++j)
            {
                DataGridViewRow row = new DataGridViewRow();                                    // how can I remove the dumb current cell pointer that makes the header cells so big/obfuscates the header text?
                row.HeaderCell.Value = "seq"+(j+1);
                row.Height = 20;
                for (int i = 0; i < m_numberOfSequences; ++i)
                {
                    DataGridViewCell cell = new DataGridViewTextBoxCell();
                    row.Cells.Add(cell);
                }
                dataView.RowHeadersWidthSizeMode=DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
                m_dataView.Rows.Add(row);
            }
            dataView.CurrentCell = null;
        }
开发者ID:YazanHalawa,项目名称:CS-312,代码行数:30,代码来源:ResultTable.cs


示例18: SCCInfoFormLoad

        private void SCCInfoFormLoad(object sender, EventArgs e)
        {
            byte DEFAULT_ALPHA = 255;
            for (int i = 0; i < SCCInfo.StrongConnectedComponent.StrongConnectedComponentCount; ++i)
            {
                DataGridViewRow tableRow = new DataGridViewRow();

                DataGridViewTextBoxCell numCell = new DataGridViewTextBoxCell();
                numCell.Value = (i + 1).ToString();

                DataGridViewTextBoxCell color = new DataGridViewTextBoxCell();
                color.Style.BackColor = System.Drawing.Color.FromArgb
                        (DEFAULT_ALPHA, SCCInfo.VertexColors[i].R, SCCInfo.VertexColors[i].G, SCCInfo.VertexColors[i].B);

                DataGridViewTextBoxCell vertices = new DataGridViewTextBoxCell();
                for (int j = 0; j < SCCInfo.StrongConnectedComponent.GetStrongConnegtionComponentVerticesCount(i) - 1; ++j)
                    vertices.Value += (SCCInfo.StrongConnectedComponent.GetVertex(i, j) + 1).ToString() + ", ";
                vertices.Value += (SCCInfo.StrongConnectedComponent.GetVertex(i, SCCInfo.StrongConnectedComponent.GetStrongConnegtionComponentVerticesCount(i) - 1) + 1).ToString();

                tableRow.Cells.Add(numCell);
                tableRow.Cells.Add(color);
                tableRow.Cells.Add(vertices);

                SCCTable.Rows.Add(tableRow);
            }
        }
开发者ID:Confirmit,项目名称:Students,代码行数:26,代码来源:SCCInfoForm.cs


示例19: AddTimestampColumns

        private void AddTimestampColumns()
        {
            DataGridViewCell cell = new DataGridViewTextBoxCell();
            DataGridViewColumn column = new DataGridViewColumn();

            column.HeaderText = "Total Hours";
            column.Name = "TotalHours";
            column.CellTemplate = cell;
            column.ReadOnly = true;

            this.gridTimestamps.Columns.Add( column );

            cell = new DataGridViewTextBoxCell();
            column = new DataGridViewColumn();

            column.HeaderText = "Hourly Rate";
            column.Name = "HourlyRate";
            column.CellTemplate = cell;
            column.ReadOnly = true;

            this.gridTimestamps.Columns.Add( column );

            cell = new DataGridViewTextBoxCell();
            column = new DataGridViewColumn();

            column.HeaderText = "Amount";
            column.Name = "Amount";
            column.CellTemplate = cell;
            column.ReadOnly = true;

            this.gridTimestamps.Columns.Add( column );
        }
开发者ID:mtrainham,项目名称:mjt-PoolTime,代码行数:32,代码来源:ViewPlayerForm.cs


示例20: ResultTable

        public ResultTable(DataGridView dataView, int numberOfSequences)
        {
            m_dataView = dataView;
            m_numberOfSequences = numberOfSequences;

            m_results = new double[m_numberOfSequences, m_numberOfSequences];

            for (int i = 0; i < m_numberOfSequences; ++i)
            {
                DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn();
                column.MaxInputLength = 8;
                column.Width = 50;
                DataGridViewCell cell = new DataGridViewTextBoxCell();
                column.CellTemplate = cell;
                m_dataView.Columns.Add(column);
            }

            for (int j = 0; j < m_numberOfSequences; ++j)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.Height = 20;
                for (int i = 0; i < m_numberOfSequences; ++i)
                {
                    DataGridViewCell cell = new DataGridViewTextBoxCell();
                    //cell.Value = ((double)i);
                    //cell.Value = "asdas";
                    row.Cells.Add(cell);
                }

                m_dataView.Rows.Add(row);
            }
        }
开发者ID:kbpontius,项目名称:CS312-Project4,代码行数:32,代码来源:ResultTable.cs



注:本文中的System.Windows.Forms.DataGridViewTextBoxCell类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.DataGridViewTextBoxColumn类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DataGridViewSortCompareEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap