2 * Namespace: System.Web.UI.WebControls
\r
5 * Author: Gaurav Vaish
\r
6 * Maintainer: gvaish@iitk.ac.in
\r
7 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
\r
8 * Implementation: yes
\r
11 * (C) Gaurav Vaish (2001)
\r
15 using System.ComponentModel;
\r
17 using System.Web.UI;
\r
19 namespace System.Web.UI.WebControls
\r
21 public class BoundColumn : DataGridColumn
\r
23 public static readonly string thisExpr = "!";
\r
25 private string dataField;
\r
26 private string dataFormatString;
\r
27 private bool readOnly;
\r
29 private PropertyDescriptor desc;
\r
31 public BoundColumn(): base()
\r
33 //TODO: The start work
\r
37 public override void Initialize()
\r
40 dataField = String.Empty;
\r
41 dataFormatString = String.Empty;
\r
46 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
\r
49 base.InitializeCell(cell, columnIndex, itemType);
\r
54 throw new NotImplementedException();
\r
57 public virtual string DataField
\r
69 public virtual string DataFormatString
\r
73 return dataFormatString;
\r
77 dataFormatString = value;
\r
81 public virtual bool ReadOnly
\r
93 protected virtual string FormatDataValue(Object dataValue)
\r
95 // TODO: How to extract the value from the object?
\r
96 // TODO: Then format the value. Here's a possible solution
\r
97 if(dataFormatString == null || dataFormatString.equals(String.Empty))
\r
98 return dataValue.toString();
\r
99 if(dataValue is DateTime)
\r
100 return ((DateTime)dataValue).toString(dataFormatString);
\r
101 throw new NotImplementedException();
\r
102 // and so on for int, String, double..
\r
103 // something's wrong here. there must be some shorter method!
\r
104 //string val = dataValue.toString(dataFormatString);
\r