标签:for int column mode not new alc resize grid
void DGV_Init() { //名称 类型 设备数 累计转发次数 累计转发数据数 状态 for (int i = 0; i < 6; i++) { DataGridViewTextBoxColumn dc = new DataGridViewTextBoxColumn(); dc.DataPropertyName = "FID"; dc.SortMode = DataGridViewColumnSortMode.NotSortable; DGV_DetailsViewer.Columns.Add(dc); } DGV_DetailsViewer.Columns[0].Name = "Name"; DGV_DetailsViewer.Columns[1].Name = "Type"; DGV_DetailsViewer.Columns[2].Name = "DevNUM"; DGV_DetailsViewer.Columns[3].Name = "TotalCnt"; DGV_DetailsViewer.Columns[4].Name = "TotalDataCnt"; DGV_DetailsViewer.Columns[5].Name = "State"; DGV_DetailsViewer.Columns[0].HeaderText = "实例名称"; DGV_DetailsViewer.Columns[1].HeaderText = "实例类型"; DGV_DetailsViewer.Columns[2].HeaderText = "转发设备数"; DGV_DetailsViewer.Columns[3].HeaderText = "累计转发次数"; DGV_DetailsViewer.Columns[4].HeaderText = "累计转发数据"; DGV_DetailsViewer.Columns[5].HeaderText = "是否启用"; DGV_DetailsViewer.Columns[0].ReadOnly = true; DGV_DetailsViewer.Columns[1].ReadOnly = true; DGV_DetailsViewer.Columns[2].ReadOnly = true; DGV_DetailsViewer.Columns[3].ReadOnly = true; DGV_DetailsViewer.Columns[4].ReadOnly = true; DGV_DetailsViewer.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; DGV_DetailsViewer.AllowUserToResizeColumns = false; DGV_DetailsViewer.AllowUserToResizeRows = false; }
标签:for int column mode not new alc resize grid
原文地址:https://www.cnblogs.com/Chendezhou/p/9134757.html