Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
comparison FrmUnit.cs @ 166:97fd4b6f823b
Fixes #294: Fix data grid header wrapping problems
* Disable wrapping on each column as it is created
* Just to make sure, disable header height resizing
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 24 Jul 2010 10:19:47 +0000 |
parents | 2c17714ad71b |
children | 1ca23c47345a |
comparison
equal
deleted
inserted
replaced
165:2c17714ad71b | 166:97fd4b6f823b |
---|---|
176 col.Name = slotName; | 176 col.Name = slotName; |
177 col.HeaderText = slotName; | 177 col.HeaderText = slotName; |
178 col.DataPropertyName = slotName; | 178 col.DataPropertyName = slotName; |
179 col.SortMode = DataGridViewColumnSortMode.NotSortable; | 179 col.SortMode = DataGridViewColumnSortMode.NotSortable; |
180 col.CellTemplate = new StatsDataGridViewCell(); | 180 col.CellTemplate = new StatsDataGridViewCell(); |
181 col.HeaderCell.Style.WrapMode = DataGridViewTriState.False; | |
181 return col; | 182 return col; |
182 } | 183 } |
183 | 184 |
184 private static void SetNameColumnWidth(DataGridView statsGrid, int otherStatsWidth) | 185 private static void SetNameColumnWidth(DataGridView statsGrid, int otherStatsWidth) |
185 { | 186 { |
207 statsGrid.RowHeadersVisible = false; | 208 statsGrid.RowHeadersVisible = false; |
208 statsGrid.Size = new System.Drawing.Size(600, 88); | 209 statsGrid.Size = new System.Drawing.Size(600, 88); |
209 statsGrid.TabStop = false; | 210 statsGrid.TabStop = false; |
210 statsGrid.AllowUserToAddRows = false; | 211 statsGrid.AllowUserToAddRows = false; |
211 statsGrid.ScrollBars = ScrollBars.None; | 212 statsGrid.ScrollBars = ScrollBars.None; |
212 statsGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; | 213 statsGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; |
213 statsGrid.BorderStyle = BorderStyle.None; | 214 statsGrid.BorderStyle = BorderStyle.None; |
214 statsGrid.BackgroundColor = SystemColors.Control; | 215 statsGrid.BackgroundColor = SystemColors.Control; |
215 statsGrid.RowsAdded += new DataGridViewRowsAddedEventHandler(statsGrid_RowsAdded); | 216 statsGrid.RowsAdded += new DataGridViewRowsAddedEventHandler(statsGrid_RowsAdded); |
216 statsPanel.Controls.Add(statsGrid); | 217 statsPanel.Controls.Add(statsGrid); |
217 statsGrid.Width = statsPanel.Width - (int)Math.Round(SystemInformation.VerticalScrollBarWidth * 1.4); | 218 statsGrid.Width = statsPanel.Width - (int)Math.Round(SystemInformation.VerticalScrollBarWidth * 1.4); |