Page.Validate() is called when CausesValidation=true
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / EditCommandColumn.cs
index 263d216929133fc2f843714e462b3a65535a8dbe..ded2f49a8bb2928ff6016ea5a7a1e287a24a6136 100644 (file)
@@ -116,14 +116,14 @@ namespace System.Web.UI.WebControls {
                                case ListItemType.Item:
                                case ListItemType.SelectedItem:
                                case ListItemType.AlternatingItem:{
-                                       cell.Controls.Add(CreateButton(ButtonType, EditText, "Edit"));
+                                       cell.Controls.Add(CreateButton(ButtonType, EditText, "Edit", false));
                                        break;
                                }
 
                                case ListItemType.EditItem: {
-                                       cell.Controls.Add(CreateButton(ButtonType, UpdateText, "Update"));
+                                       cell.Controls.Add(CreateButton(ButtonType, UpdateText, "Update", true));
                                        cell.Controls.Add(new LiteralControl(" "));
-                                       cell.Controls.Add(CreateButton(ButtonType, CancelText, "Cancel"));
+                                       cell.Controls.Add(CreateButton(ButtonType, CancelText, "Cancel", false));
                                        break;
                                }
                        }
@@ -131,20 +131,22 @@ namespace System.Web.UI.WebControls {
                #endregion      // Public Instance Methods
 
                #region Private Methods
-               private Control CreateButton(ButtonColumnType type, string text, string command) {
+               private Control CreateButton(ButtonColumnType type, string text, string command, bool valid) {
                        Button b;
                        LinkButton d;
 
                        if (type == ButtonColumnType.LinkButton) {
-                               d = new LinkButton();
+                               d = new ForeColorLinkButton();
                                d.Text = text;
                                d.CommandName = command;
+                               d.CausesValidation = valid;
                                return d;
                        }
 
                        b = new Button();
                        b.Text = text;
                        b.CommandName = command;
+                       b.CausesValidation = valid;
                        return b;
                }
                #endregion      // Private Methods