Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
diff UI/StatsDataGridViewCell.cs @ 151:540c8aa6e565
Re #269: Handle multiple stat lines
* Start to rebuild UI using DataGridView, as we can get the header height from that and it replaces the original DataGrid
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Thu, 06 May 2010 20:05:43 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UI/StatsDataGridViewCell.cs Thu May 06 20:05:43 2010 +0000 @@ -0,0 +1,19 @@ +// This file (StatsDataGridViewCell.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2010 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.GUI.WinForms.UI +{ + public class StatsDataGridViewCell : DataGridViewTextBoxCell + { + protected override Object GetFormattedValue(Object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) + { + return value == null ? "" : ((Stat)value).SlotValueString; + } + } +}