2006-12-07 Igor Zelmanovich <igorz@mainsoft.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / BoundField.cs
index 09a9dcc6abcc1ff84dc29cfc43fd8f1829d55597..2e1916c4ecbd02bf87356ca89d2dd57da147a609 100644 (file)
@@ -92,7 +92,6 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-               [MonoTODO]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public override string HeaderText {
@@ -150,7 +149,6 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-               [MonoTODO]
                public override bool Initialize (bool enableSorting, 
                                                 Control control)
                {
@@ -185,8 +183,14 @@ namespace System.Web.UI.WebControls {
                protected virtual string FormatDataValue (object value, bool encode)
                {
                        string res;
-                       if (value == null || (value.ToString().Length == 0 && ConvertEmptyStringToNull))
-                               res = NullDisplayText;
+                       if (value == null || (value.ToString ().Length == 0 && ConvertEmptyStringToNull)) {
+                               if (NullDisplayText.Length == 0) {
+                                       encode = false;
+                                       res = "&nbsp;";
+                               }
+                               else
+                                       res = NullDisplayText;
+                       }
                        else if (DataFormatString.Length > 0)
                                res = string.Format (DataFormatString, value);
                        else
@@ -206,7 +210,7 @@ namespace System.Web.UI.WebControls {
                
                protected virtual object GetDesignTimeValue ()
                {
-                       return GetBoundValue (Control);
+                       return "Databound";
                }
 
                object GetBoundValue (Control controlContainer)
@@ -217,6 +221,8 @@ namespace System.Web.UI.WebControls {
 
                        if (DataField == ThisExpression)
                                return dataItem.ToString ();
+                       else if (DataField == string.Empty)
+                               return null;
 
                        return DataBinder.GetPropertyValue (dataItem, DataField);
                }
@@ -257,10 +263,12 @@ namespace System.Web.UI.WebControls {
                        field.HtmlEncode = HtmlEncode;
                }
 
-               [MonoTODO]
+               // MSDN: The ValidateSupportsCallback method is a helper method used to determine 
+               // whether the controls contained in a BoundField object support callbacks. 
+               // This method has been implemented as an empty method (a method that does not contain 
+               // any code) to indicate that callbacks are supported.
                public override void ValidateSupportsCallback ()
                {
-                       throw new NotImplementedException ();
                }
 
        }