2007-07-24 Igor Zelmanovich <igorz@mainsoft.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / DataControlField.cs
index d49845c00c70e2d23870f2760481637924106191..93e0fbc5653a04c4130b2b8eeac7552ebb888467 100644 (file)
@@ -85,7 +85,7 @@ namespace System.Web.UI.WebControls {
                        if (cellType == DataControlCellType.Header)
                        {
                                if (HeaderText.Length > 0 && sortingEnabled && SortExpression.Length > 0)
-                                       cell.Controls.Add (new DataControlButton (control, HeaderText, HeaderImageUrl, DataControlCommands.SortCommandName, SortExpression, true));
+                                       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;