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
10 * (C) Gaurav Vaish (2001)
\r
14 using System.ComponentModel;
\r
16 using System.Web.UI;
\r
18 namespace System.Web.UI.WebControls
\r
20 public class BoundColumn : DataGridColumn
\r
22 public static readonly string thisExpr = "!";
\r
24 private string dataField;
\r
25 private string dataFormatString;
\r
26 private bool readOnly;
\r
28 private PropertyDescriptor desc;
\r
30 public BoundColumn(): base()
\r
32 //TODO: The start work
\r
36 public override void Initialize()
\r
39 dataField = String.Empty;
\r
40 dataFormatString = String.Empty;
\r
45 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
\r
48 base.InitializeCell(cell, columnIndex, itemType);
\r
53 throw new NotImplementedException();
\r
56 public virtual string DataField
\r
68 public virtual string DataFormatString
\r
72 return dataFormatString;
\r
76 dataFormatString = value;
\r
80 public virtual bool ReadOnly
\r
92 protected virtual string FormatDataValue(Object dataValue)
\r
94 // TODO: How to extract the value from the object?
\r
95 // TODO: Then format the value. Here's a possible solution
\r
96 if(dataFormatString == null || dataFormatString.equals(String.Empty))
\r
97 return dataValue.toString();
\r
98 if(dataValue is DateTime)
\r
99 return ((DateTime)dataValue).toString(dataFormatString);
\r
100 throw new NotImplementedException();
\r
101 // and so on for int, String, double..
\r
102 // something's wrong here. there must be some shorter method!
\r
103 //string val = dataValue.toString(dataFormatString);
\r