ChangeLog: Updated.
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / BoundColumn.cs
index db5ed50cb45d163a765e78003e952a48a2884678..04654f8c706ccb4e15e16d8cac822aea97e5f715 100755 (executable)
@@ -1,15 +1,34 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class:     BoundColumn
- *
- * Author:  Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status:  60%
- *
- * (C) Gaurav Vaish (2001)
- */
+//
+// System.Web.UI.WebControls.BoundColumn.cs
+//
+// Authors:
+//   Gaurav Vaish (gvaish@iitk.ac.in)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) Gaurav Vaish (2002)
+// (C) 2003 Andreas Nahr
+//\r
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.ComponentModel;
@@ -22,7 +41,7 @@ namespace System.Web.UI.WebControls
        {
                public static readonly string thisExpr = "!";
 
-               private bool boundFieldDesciptionValid;
+               private bool boundFieldDescriptionValid;
                private string boundField;
                private string formatting;
                
@@ -39,7 +58,7 @@ namespace System.Web.UI.WebControls
                        desc       = null;
                        boundField = DataField;
                        formatting = DataFormatString;
-                       boundFieldDesciptionValid = false;
+                       boundFieldDescriptionValid = false;
                }
 
                public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
@@ -61,10 +80,12 @@ namespace System.Web.UI.WebControls
                                                           : if(!ReadOnly)
                                                             {
                                                                TextBox box = new TextBox();
-                                                               toAdd = box;
-                                                               if(DataField.Length != 0)
-                                                                       bindCtrl = box;
-                                                            }
+                                                               toAdd = box;
+                                                               if(DataField.Length != 0)
+                                                                       bindCtrl = box;
+                                                            } else 
+                                                                    goto case ListItemType.SelectedItem;
+
                                                             break;
                        }
                        if(toAdd != null)
@@ -80,7 +101,7 @@ namespace System.Web.UI.WebControls
                        DataGridItem item  = (DataGridItem)senderCtrl.NamingContainer;
                        object       data  = item.DataItem;
 
-                       if(!boundFieldDesciptionValid)
+                       if(!boundFieldDescriptionValid)
                        {
                                if(boundField != BoundColumn.thisExpr)
                                {
@@ -91,7 +112,7 @@ namespace System.Web.UI.WebControls
                                                          HttpRuntime.FormatResourceString("File_Not_Found",
                                                                                           boundField));
                                        }
-                                       boundFieldDesciptionValid = true;
+                                       boundFieldDescriptionValid = true;
                                }
                        }
                        object value = data;
@@ -116,6 +137,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
+               [DefaultValue (""), WebCategory ("Misc")]
+               [WebSysDescription ("The field that this column is bound to.")]
                public virtual string DataField
                {
                        get
@@ -132,6 +155,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
+               [DefaultValue (""), WebCategory ("Misc")]
+               [WebSysDescription ("A format string that is applied to the data value.")]
                public virtual string DataFormatString
                {
                        get
@@ -148,6 +173,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
+               [DefaultValue (false), WebCategory ("Misc")]
+               [WebSysDescription ("Determines if the databound field can only be displayed or also edited.")]
                public virtual bool ReadOnly
                {
                        get