{
this.sortingEnabled = sortingEnabled;
this.control = control;
- return true;
+ return false;
}
public virtual void InitializeCell (DataControlFieldCell cell,
{
if (cellType == DataControlCellType.Header)
{
- if (HeaderText.Length > 0 || HeaderImageUrl.Length > 0) {
- if (sortingEnabled && SortExpression.Length > 0)
- cell.Controls.Add (new DataControlButton (control, HeaderText, HeaderImageUrl, DataControlCommands.SortCommandName, SortExpression, true));
- else
- cell.Controls.Add (new DataControlButton (control, HeaderText, HeaderImageUrl, string.Empty, string.Empty, true));
+ if (HeaderText.Length > 0 && sortingEnabled && SortExpression.Length > 0)
+ cell.Controls.Add ((Control) DataControlButton.CreateButton (String.IsNullOrEmpty (HeaderImageUrl) ? ButtonType.Link : ButtonType.Image, control, HeaderText, HeaderImageUrl, DataControlCommands.SortCommandName, SortExpression, true));
+ else if (HeaderImageUrl.Length > 0) {
+ Image image = new Image ();
+ image.ImageUrl = HeaderImageUrl;
+ cell.Controls.Add (image);
}
+ else
+ cell.Text = HeaderText.Length > 0 ? HeaderText : " ";
}
else if (cellType == DataControlCellType.Footer) {
- cell.Text = FooterText;
+ string footerText = FooterText;
+ cell.Text = (footerText.Length > 0) ? footerText : " ";
}
}
viewState.LoadViewState (states[0]);
if (states[1] != null)
- ((IStateManager)controlStyle).LoadViewState (states[1]);
+ ((IStateManager)ControlStyle).LoadViewState (states[1]);
if (states[2] != null)
- ((IStateManager)footerStyle).LoadViewState (states[2]);
+ ((IStateManager)FooterStyle).LoadViewState (states[2]);
if (states[3] != null)
- ((IStateManager)headerStyle).LoadViewState (states[3]);
+ ((IStateManager)HeaderStyle).LoadViewState (states[3]);
if (states[4] != null)
- ((IStateManager)itemStyle).LoadViewState (states[4]);
+ ((IStateManager)ItemStyle).LoadViewState (states[4]);
}
protected virtual object SaveViewState()
return new System.NotSupportedException ("The property '" + propName + "' is not supported in " + GetType().Name);
}
+ internal bool ControlStyleCreated { get { return controlStyle != null; } }
+
+ internal bool HeaderStyleCreated { get { return headerStyle != null; } }
+
+ internal bool FooterStyleCreated { get { return footerStyle != null; } }
+
+ internal bool ItemStyleCreated { get { return itemStyle != null; } }
+
[MonoTODO ("Render this")]
[DefaultValueAttribute ("")]
[LocalizableAttribute (true)]
[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
[DefaultValueAttribute (null)]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
- public virtual Style ControlStyle {
+ public Style ControlStyle {
get {
if (controlStyle == null) {
controlStyle = new Style ();
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
[WebCategoryAttribute ("Styles")]
- public virtual TableItemStyle FooterStyle {
+ public TableItemStyle FooterStyle {
get {
if (footerStyle == null) {
footerStyle = new TableItemStyle ();
[WebCategoryAttribute ("Styles")]
[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
[DefaultValueAttribute (null)]
- public virtual TableItemStyle HeaderStyle {
+ public TableItemStyle HeaderStyle {
get {
if (headerStyle == null) {
headerStyle = new TableItemStyle ();
[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
[WebCategoryAttribute ("Styles")]
[DefaultValueAttribute (null)]
- public virtual TableItemStyle ItemStyle {
+ public TableItemStyle ItemStyle {
get {
if (itemStyle == null) {
itemStyle = new TableItemStyle ();
}
internal event EventHandler FieldChanged;
+
+ public override string ToString ()
+ {
+ if (string.IsNullOrEmpty (HeaderText))
+ return base.ToString ();
+ return HeaderText;
+ }
}
}
#endif