diff options
author | Marek Habersack <grendel@twistedcode.net> | 2010-03-29 20:59:51 +0400 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2010-03-29 20:59:51 +0400 |
commit | 4dbe92e064c3ace8309fc5f1559bb8b4d4fe14cb (patch) | |
tree | 6575eeb8421abb8c13b049193660c0b4a2d06b4c /mcs | |
parent | 62d82250ed40ba6c02bc60c1e3b722219594155e (diff) |
Backport of r154386
svn path=/branches/mono-2-6/mcs/; revision=154387
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index 2d5c3ee0500..9edd9b79871 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,8 @@ +2010-03-29 Marek Habersack <mhabersack@novell.com> + + * GridView.cs: main table must be created and added to the + controls collection before any OnRowCreated event is fired. + 2010-03-19 Gonzalo Paniagua Javier <gonzalo@novell.com> * TreeView.cs: use enums instead of strings for attributes. diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs index 10ec977b621..72af5103949 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs @@ -1309,6 +1309,7 @@ namespace System.Web.UI.WebControls } // Main table creation + Table mainTable = ContainedTable; while (skip_first || enumerator.MoveNext ()) { skip_first = false; object obj = enumerator.Current; @@ -1317,7 +1318,7 @@ namespace System.Web.UI.WebControls if (createPager && (PagerSettings.Position == PagerPosition.Top || PagerSettings.Position == PagerPosition.TopAndBottom)) { topPagerRow = CreatePagerRow (fieldCount, dataSource); OnRowCreated (new GridViewRowEventArgs (topPagerRow)); - ContainedTable.Rows.Add (topPagerRow); + mainTable.Rows.Add (topPagerRow); if (dataBinding) { topPagerRow.DataBind (); OnRowDataBound (new GridViewRowEventArgs (topPagerRow)); @@ -1329,7 +1330,7 @@ namespace System.Web.UI.WebControls GridViewRow headerRow = CreateRow (-1, -1, DataControlRowType.Header, DataControlRowState.Normal); InitializeRow (headerRow, fields); OnRowCreated (new GridViewRowEventArgs (headerRow)); - ContainedTable.Rows.Add (headerRow); + mainTable.Rows.Add (headerRow); if (dataBinding) { headerRow.DataBind (); OnRowDataBound (new GridViewRowEventArgs (headerRow)); @@ -1342,7 +1343,7 @@ namespace System.Web.UI.WebControls list.Add (row); InitializeRow (row, fields); OnRowCreated (new GridViewRowEventArgs (row)); - ContainedTable.Rows.Add (row); + mainTable.Rows.Add (row); if (dataBinding) { row.DataBind (); if (EditIndex == row.RowIndex) @@ -1356,7 +1357,7 @@ namespace System.Web.UI.WebControls GridViewRow emptyRow = CreateEmptyrRow (fieldCount); if (emptyRow != null) { OnRowCreated (new GridViewRowEventArgs (emptyRow)); - ContainedTable.Rows.Add (emptyRow); + mainTable.Rows.Add (emptyRow); if (dataBinding) { emptyRow.DataBind (); OnRowDataBound (new GridViewRowEventArgs (emptyRow)); @@ -1368,7 +1369,7 @@ namespace System.Web.UI.WebControls GridViewRow footerRow = CreateRow (-1, -1, DataControlRowType.Footer, DataControlRowState.Normal); InitializeRow (footerRow, fields); OnRowCreated (new GridViewRowEventArgs (footerRow)); - ContainedTable.Rows.Add (footerRow); + mainTable.Rows.Add (footerRow); if (dataBinding) { footerRow.DataBind (); OnRowDataBound (new GridViewRowEventArgs (footerRow)); @@ -1377,7 +1378,7 @@ namespace System.Web.UI.WebControls if (createPager && (PagerSettings.Position == PagerPosition.Bottom || PagerSettings.Position == PagerPosition.TopAndBottom)) { bottomPagerRow = CreatePagerRow (fieldCount, dataSource); OnRowCreated (new GridViewRowEventArgs (bottomPagerRow)); - ContainedTable.Rows.Add (bottomPagerRow); + mainTable.Rows.Add (bottomPagerRow); if (dataBinding) { bottomPagerRow.DataBind (); OnRowDataBound (new GridViewRowEventArgs (bottomPagerRow)); |