From 0037f9d7477a3ae585162a3e0713a98e7ffc540f Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Thu, 4 Jan 2007 20:22:33 +0000 Subject: 2006-01-04 Carlos Alberto Cortez * ColumnHeader.cs: * ListView.cs: Implement 2.0 ColumnHeader.DisplayIndex property by using the internal information of the columns order in ListView. svn path=/trunk/mcs/; revision=70497 --- .../System.Windows.Forms/ColumnHeader.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs') diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs index c287171ebc8..807c0f6a794 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs @@ -170,8 +170,20 @@ namespace System.Windows.Forms [Localizable (true)] [RefreshProperties (RefreshProperties.Repaint)] public int DisplayIndex { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } + get { + if (owner == null) + return -1; + + return owner.GetReorderedColumnIndex (this); + } + set { + if (owner == null) + return; + if (value < 0 || value >= owner.Columns.Count) + throw new ArgumentOutOfRangeException ("value"); + + owner.ReorderColumn (this, value); + } } [DefaultValue (-1)] -- cgit v1.2.3