Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Maurer <benm@mono-cvs.ximian.com>2003-10-22 06:41:57 +0400
committerBen Maurer <benm@mono-cvs.ximian.com>2003-10-22 06:41:57 +0400
commit9d108aea014ac8983a44c51e0ceb8553e288a32d (patch)
tree9c5a4857441b4f1750d9ce02c7bd95d6aa91d59e
parent9115c1fb5fe0301b41102204063fe02f152cdaff (diff)
2003-10-21 Ben Maurer <bmaurer@users.sourceforge.net>
* EditCommandColumn.cs: Implement; fix #49736 svn path=/trunk/mcs/; revision=19291
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs30
2 files changed, 31 insertions, 3 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index 393352b0bdc..65492916ec0 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,5 +1,9 @@
2003-10-21 Ben Maurer <bmaurer@users.sourceforge.net>
+ * EditCommandColumn.cs: Implement; fix #49736
+
+2003-10-21 Ben Maurer <bmaurer@users.sourceforge.net>
+
* ButtonColumn.cs: Use the DataGridLinkButton, so that we inherit
the forground color. bug #49738
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs
index 7779f07ce11..ff4bc967692 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs
@@ -6,7 +6,7 @@
* Maintainer: gvaish@iitk.ac.in
* Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
* Implementation: yes
- * Status: 95%
+ * Status: 100%
*
* (C) Gaurav Vaish (2002)
*/
@@ -99,11 +99,35 @@ namespace System.Web.UI.WebControls
}
}
- [MonoTODO]
public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
- //TODO: I have to read some documents.
+
+ if (itemType == ListItemType.Header || itemType == ListItemType.Footer)
+ return;
+
+ if (itemType == ListItemType.EditItem) {
+ cell.Controls.Add (MakeButton ("Update", UpdateText));
+ cell.Controls.Add (new LiteralControl (" "));
+ cell.Controls.Add (MakeButton ("Cancel", CancelText));
+ } else {
+ cell.Controls.Add (MakeButton ("Edit", EditText));
+ }
+ }
+
+ Control MakeButton (string commandName, string text)
+ {
+ if (ButtonType == ButtonColumnType.LinkButton) {
+ DataGridLinkButton ret = new DataGridLinkButton ();
+ ret.CommandName = commandName;
+ ret.Text = text;
+ return ret;
+ } else {
+ Button ret = new Button ();
+ ret.CommandName = commandName;
+ ret.Text = text;
+ return ret;
+ }
}
}
}