|
|
@@ -40,13 +40,14 @@ using System.Reflection;
|
|
|
|
|
|
namespace System.Web.UI.WebControls
|
|
|
{
|
|
|
+ [SupportsEventValidation]
|
|
|
[ToolboxDataAttribute ("<{0}:DetailsView runat=\"server\" Width=\"125px\" Height=\"50px\"></{0}:DetailsView>")]
|
|
|
[DesignerAttribute ("System.Web.UI.Design.WebControls.DetailsViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
|
|
|
[ControlValuePropertyAttribute ("SelectedValue")]
|
|
|
[DefaultEventAttribute ("PageIndexChanging")]
|
|
|
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
|
|
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
|
|
- public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer
|
|
|
+ public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
|
|
|
{
|
|
|
object dataItem;
|
|
|
|
|
|
@@ -272,7 +273,7 @@ namespace System.Web.UI.WebControls
|
|
|
|
|
|
[WebCategoryAttribute ("Paging")]
|
|
|
[DefaultValueAttribute (false)]
|
|
|
- public bool AllowPaging {
|
|
|
+ public virtual bool AllowPaging {
|
|
|
get {
|
|
|
object ob = ViewState ["AllowPaging"];
|
|
|
if (ob != null) return (bool) ob;
|
|
|
@@ -285,11 +286,11 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
|
|
|
[DefaultValueAttribute (null)]
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle AlternatingRowStyle {
|
|
|
+ public TableItemStyle AlternatingRowStyle {
|
|
|
get {
|
|
|
if (alternatingRowStyle == null) {
|
|
|
alternatingRowStyle = new TableItemStyle ();
|
|
|
@@ -384,7 +385,7 @@ namespace System.Web.UI.WebControls
|
|
|
[WebCategoryAttribute ("Accessibility")]
|
|
|
[DefaultValueAttribute ("")]
|
|
|
[LocalizableAttribute (true)]
|
|
|
- public string Caption {
|
|
|
+ public virtual string Caption {
|
|
|
get {
|
|
|
object ob = ViewState ["Caption"];
|
|
|
if (ob != null) return (string) ob;
|
|
|
@@ -442,11 +443,11 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
|
|
|
[DefaultValueAttribute (null)]
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle CommandRowStyle {
|
|
|
+ public TableItemStyle CommandRowStyle {
|
|
|
get {
|
|
|
if (commandRowStyle == null) {
|
|
|
commandRowStyle = new TableItemStyle ();
|
|
|
@@ -457,16 +458,16 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
- [BrowsableAttribute (false)]
|
|
|
+ [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
+ [BrowsableAttribute (false)]
|
|
|
public DetailsViewMode CurrentMode {
|
|
|
get {
|
|
|
return currentMode;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [DefaultValueAttribute (DetailsViewMode.ReadOnly)]
|
|
|
- [WebCategoryAttribute ("Behavior")]
|
|
|
+ [DefaultValueAttribute (DetailsViewMode.ReadOnly)]
|
|
|
+ [WebCategoryAttribute ("Behavior")]
|
|
|
public virtual DetailsViewMode DefaultMode {
|
|
|
get {
|
|
|
object o = ViewState ["DefaultMode"];
|
|
|
@@ -522,12 +523,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- [DefaultValueAttribute (null)]
|
|
|
- public virtual TableItemStyle EditRowStyle {
|
|
|
+ [DefaultValueAttribute (null)]
|
|
|
+ public TableItemStyle EditRowStyle {
|
|
|
get {
|
|
|
if (editRowStyle == null) {
|
|
|
editRowStyle = new TableItemStyle ();
|
|
|
@@ -538,12 +539,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- [DefaultValueAttribute (null)]
|
|
|
- public virtual TableItemStyle EmptyDataRowStyle {
|
|
|
+ [DefaultValueAttribute (null)]
|
|
|
+ public TableItemStyle EmptyDataRowStyle {
|
|
|
get {
|
|
|
if (emptyDataRowStyle == null) {
|
|
|
emptyDataRowStyle = new TableItemStyle ();
|
|
|
@@ -557,8 +558,8 @@ namespace System.Web.UI.WebControls
|
|
|
[DefaultValue (null)]
|
|
|
[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
- [Browsable (false)]
|
|
|
- public ITemplate EmptyDataTemplate {
|
|
|
+ [Browsable (false)]
|
|
|
+ public virtual ITemplate EmptyDataTemplate {
|
|
|
get { return emptyDataTemplate; }
|
|
|
set { emptyDataTemplate = value; RequireBinding (); }
|
|
|
}
|
|
|
@@ -592,12 +593,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DefaultValue (null)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle FieldHeaderStyle {
|
|
|
+ public TableItemStyle FieldHeaderStyle {
|
|
|
get {
|
|
|
if (fieldHeaderStyle == null) {
|
|
|
fieldHeaderStyle = new TableItemStyle ();
|
|
|
@@ -620,16 +621,16 @@ namespace System.Web.UI.WebControls
|
|
|
[DefaultValue (null)]
|
|
|
[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
- [Browsable (false)]
|
|
|
- public ITemplate FooterTemplate {
|
|
|
+ [Browsable (false)]
|
|
|
+ public virtual ITemplate FooterTemplate {
|
|
|
get { return footerTemplate; }
|
|
|
set { footerTemplate = value; RequireBinding (); }
|
|
|
}
|
|
|
|
|
|
- [LocalizableAttribute (true)]
|
|
|
- [WebCategoryAttribute ("Appearance")]
|
|
|
- [DefaultValueAttribute ("")]
|
|
|
- public string FooterText {
|
|
|
+ [LocalizableAttribute (true)]
|
|
|
+ [WebCategoryAttribute ("Appearance")]
|
|
|
+ [DefaultValueAttribute ("")]
|
|
|
+ public virtual string FooterText {
|
|
|
get {
|
|
|
object ob = ViewState ["FooterText"];
|
|
|
if (ob != null) return (string) ob;
|
|
|
@@ -641,12 +642,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DefaultValue (null)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle FooterStyle {
|
|
|
+ public TableItemStyle FooterStyle {
|
|
|
get {
|
|
|
if (footerStyle == null) {
|
|
|
footerStyle = new TableItemStyle ();
|
|
|
@@ -679,12 +680,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DefaultValue (null)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle HeaderStyle {
|
|
|
+ public TableItemStyle HeaderStyle {
|
|
|
get {
|
|
|
if (headerStyle == null) {
|
|
|
headerStyle = new TableItemStyle ();
|
|
|
@@ -698,16 +699,16 @@ namespace System.Web.UI.WebControls
|
|
|
[DefaultValue (null)]
|
|
|
[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
- [Browsable (false)]
|
|
|
- public ITemplate HeaderTemplate {
|
|
|
+ [Browsable (false)]
|
|
|
+ public virtual ITemplate HeaderTemplate {
|
|
|
get { return headerTemplate; }
|
|
|
set { headerTemplate = value; RequireBinding (); }
|
|
|
}
|
|
|
|
|
|
- [LocalizableAttribute (true)]
|
|
|
- [WebCategoryAttribute ("Appearance")]
|
|
|
- [DefaultValueAttribute ("")]
|
|
|
- public string HeaderText {
|
|
|
+ [LocalizableAttribute (true)]
|
|
|
+ [WebCategoryAttribute ("Appearance")]
|
|
|
+ [DefaultValueAttribute ("")]
|
|
|
+ public virtual string HeaderText {
|
|
|
get {
|
|
|
object ob = ViewState ["HeaderText"];
|
|
|
if (ob != null) return (string) ob;
|
|
|
@@ -733,12 +734,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- [DefaultValueAttribute (null)]
|
|
|
- public virtual TableItemStyle InsertRowStyle {
|
|
|
+ [DefaultValueAttribute (null)]
|
|
|
+ public TableItemStyle InsertRowStyle {
|
|
|
get {
|
|
|
if (insertRowStyle == null) {
|
|
|
insertRowStyle = new TableItemStyle ();
|
|
|
@@ -751,7 +752,7 @@ namespace System.Web.UI.WebControls
|
|
|
|
|
|
[BrowsableAttribute (false)]
|
|
|
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
- public int PageCount {
|
|
|
+ public virtual int PageCount {
|
|
|
get {
|
|
|
if (pageCount != -1) return pageCount;
|
|
|
EnsureDataBound ();
|
|
|
@@ -760,9 +761,9 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
|
|
|
[WebCategoryAttribute ("Paging")]
|
|
|
- [BindableAttribute (true, BindingDirection.OneWay)]
|
|
|
+ [BindableAttribute (true, BindingDirection.OneWay)]
|
|
|
[DefaultValueAttribute (0)]
|
|
|
- public int PageIndex {
|
|
|
+ public virtual int PageIndex {
|
|
|
get {
|
|
|
return pageIndex;
|
|
|
}
|
|
|
@@ -776,7 +777,7 @@ namespace System.Web.UI.WebControls
|
|
|
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
|
|
|
[NotifyParentPropertyAttribute (true)]
|
|
|
[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
|
|
|
- public PagerSettings PagerSettings {
|
|
|
+ public virtual PagerSettings PagerSettings {
|
|
|
get {
|
|
|
if (pagerSettings == null) {
|
|
|
pagerSettings = new PagerSettings (this);
|
|
|
@@ -787,11 +788,11 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
- public virtual TableItemStyle PagerStyle {
|
|
|
+ public TableItemStyle PagerStyle {
|
|
|
get {
|
|
|
if (pagerStyle == null) {
|
|
|
pagerStyle = new TableItemStyle ();
|
|
|
@@ -807,8 +808,8 @@ namespace System.Web.UI.WebControls
|
|
|
/* DataControlPagerCell isnt specified in the docs */
|
|
|
//[TemplateContainer (typeof(DataControlPagerCell), BindingDirection.OneWay)]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
- [Browsable (false)]
|
|
|
- public ITemplate PagerTemplate {
|
|
|
+ [Browsable (false)]
|
|
|
+ public virtual ITemplate PagerTemplate {
|
|
|
get { return pagerTemplate; }
|
|
|
set { pagerTemplate = value; RequireBinding (); }
|
|
|
}
|
|
|
@@ -822,12 +823,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [WebCategoryAttribute ("Styles")]
|
|
|
+ [WebCategoryAttribute ("Styles")]
|
|
|
[PersistenceMode (PersistenceMode.InnerProperty)]
|
|
|
[NotifyParentProperty (true)]
|
|
|
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
|
|
[DefaultValue (null)]
|
|
|
- public virtual TableItemStyle RowStyle {
|
|
|
+ public TableItemStyle RowStyle {
|
|
|
get {
|
|
|
if (rowStyle == null) {
|
|
|
rowStyle = new TableItemStyle ();
|
|
|
@@ -838,9 +839,9 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
+ [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
[BrowsableAttribute (false)]
|
|
|
- public virtual object SelectedValue {
|
|
|
+ public object SelectedValue {
|
|
|
get { return DataKey.Value; }
|
|
|
}
|
|
|
|
|
|
@@ -855,7 +856,7 @@ namespace System.Web.UI.WebControls
|
|
|
|
|
|
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
[BrowsableAttribute (false)]
|
|
|
- public object DataItem {
|
|
|
+ public virtual object DataItem {
|
|
|
get {
|
|
|
EnsureDataBound ();
|
|
|
return dataItem;
|
|
|
@@ -870,7 +871,7 @@ namespace System.Web.UI.WebControls
|
|
|
|
|
|
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
|
|
[BrowsableAttribute (false)]
|
|
|
- public int DataItemIndex {
|
|
|
+ public virtual int DataItemIndex {
|
|
|
get { return PageIndex; }
|
|
|
}
|
|
|
|
|
|
@@ -1291,7 +1292,12 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
return base.OnBubbleEvent (source, e);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
|
|
|
+ {
|
|
|
+ RaisePostBackEvent (eventArgument);
|
|
|
+ }
|
|
|
+
|
|
|
// TODO: This is prolly obsolete
|
|
|
protected virtual void RaisePostBackEvent (string eventArgument)
|
|
|
{
|
|
|
@@ -1306,69 +1312,69 @@ namespace System.Web.UI.WebControls
|
|
|
{
|
|
|
switch (eventName)
|
|
|
{
|
|
|
- case DataControlCommands.PageCommandName:
|
|
|
- int newIndex = -1;
|
|
|
- switch (param) {
|
|
|
- case DataControlCommands.FirstPageCommandArgument:
|
|
|
- newIndex = 0;
|
|
|
- break;
|
|
|
- case DataControlCommands.LastPageCommandArgument:
|
|
|
- newIndex = PageCount - 1;
|
|
|
- break;
|
|
|
- case DataControlCommands.NextPageCommandArgument:
|
|
|
- if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
|
|
|
- break;
|
|
|
- case DataControlCommands.PreviousPageCommandArgument:
|
|
|
- if (PageIndex > 0) newIndex = PageIndex - 1;
|
|
|
- break;
|
|
|
- default:
|
|
|
- newIndex = int.Parse (param) - 1;
|
|
|
- break;
|
|
|
- }
|
|
|
- ShowPage (newIndex);
|
|
|
- break;
|
|
|
-
|
|
|
+ case DataControlCommands.PageCommandName:
|
|
|
+ int newIndex = -1;
|
|
|
+ switch (param) {
|
|
|
case DataControlCommands.FirstPageCommandArgument:
|
|
|
- ShowPage (0);
|
|
|
+ newIndex = 0;
|
|
|
break;
|
|
|
-
|
|
|
case DataControlCommands.LastPageCommandArgument:
|
|
|
- ShowPage (PageCount - 1);
|
|
|
+ newIndex = PageCount - 1;
|
|
|
break;
|
|
|
-
|
|
|
case DataControlCommands.NextPageCommandArgument:
|
|
|
- if (PageIndex < PageCount - 1)
|
|
|
- ShowPage (PageIndex + 1);
|
|
|
+ if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
|
|
|
break;
|
|
|
-
|
|
|
case DataControlCommands.PreviousPageCommandArgument:
|
|
|
- if (PageIndex > 0)
|
|
|
- ShowPage (PageIndex - 1);
|
|
|
+ if (PageIndex > 0) newIndex = PageIndex - 1;
|
|
|
break;
|
|
|
-
|
|
|
- case DataControlCommands.EditCommandName:
|
|
|
- ChangeMode (DetailsViewMode.Edit);
|
|
|
+ default:
|
|
|
+ newIndex = int.Parse (param) - 1;
|
|
|
break;
|
|
|
+ }
|
|
|
+ ShowPage (newIndex);
|
|
|
+ break;
|
|
|
|
|
|
- case DataControlCommands.NewCommandName:
|
|
|
- ChangeMode (DetailsViewMode.Insert);
|
|
|
- break;
|
|
|
+ case DataControlCommands.FirstPageCommandArgument:
|
|
|
+ ShowPage (0);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DataControlCommands.LastPageCommandArgument:
|
|
|
+ ShowPage (PageCount - 1);
|
|
|
+ break;
|
|
|
|
|
|
- case DataControlCommands.UpdateCommandName:
|
|
|
- UpdateItem (param, true);
|
|
|
- break;
|
|
|
+ case DataControlCommands.NextPageCommandArgument:
|
|
|
+ if (PageIndex < PageCount - 1)
|
|
|
+ ShowPage (PageIndex + 1);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DataControlCommands.PreviousPageCommandArgument:
|
|
|
+ if (PageIndex > 0)
|
|
|
+ ShowPage (PageIndex - 1);
|
|
|
+ break;
|
|
|
|
|
|
- case DataControlCommands.CancelCommandName:
|
|
|
- CancelEdit ();
|
|
|
- break;
|
|
|
+ case DataControlCommands.EditCommandName:
|
|
|
+ ChangeMode (DetailsViewMode.Edit);
|
|
|
+ break;
|
|
|
|
|
|
- case DataControlCommands.DeleteCommandName:
|
|
|
- DeleteItem ();
|
|
|
- break;
|
|
|
+ case DataControlCommands.NewCommandName:
|
|
|
+ ChangeMode (DetailsViewMode.Insert);
|
|
|
+ break;
|
|
|
|
|
|
- case DataControlCommands.InsertCommandName:
|
|
|
- InsertItem (true);
|
|
|
- break;
|
|
|
+ case DataControlCommands.UpdateCommandName:
|
|
|
+ UpdateItem (param, true);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DataControlCommands.CancelCommandName:
|
|
|
+ CancelEdit ();
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DataControlCommands.DeleteCommandName:
|
|
|
+ DeleteItem ();
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DataControlCommands.InsertCommandName:
|
|
|
+ InsertItem (true);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1430,7 +1436,7 @@ namespace System.Web.UI.WebControls
|
|
|
EndRowEdit ();
|
|
|
}
|
|
|
|
|
|
- bool UpdateCallback (int recordsAffected, Exception exception)
|
|
|
+ bool UpdateCallback (int recordsAffected, Exception exception)
|
|
|
{
|
|
|
DetailsViewUpdatedEventArgs dargs = new DetailsViewUpdatedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditOldValues, currentEditNewValues);
|
|
|
OnItemUpdated (dargs);
|
|
|
@@ -1464,7 +1470,7 @@ namespace System.Web.UI.WebControls
|
|
|
EndRowEdit ();
|
|
|
}
|
|
|
|
|
|
- bool InsertCallback (int recordsAffected, Exception exception)
|
|
|
+ bool InsertCallback (int recordsAffected, Exception exception)
|
|
|
{
|
|
|
DetailsViewInsertedEventArgs dargs = new DetailsViewInsertedEventArgs (recordsAffected, exception, currentEditNewValues);
|
|
|
OnItemInserted (dargs);
|
|
|
@@ -1475,7 +1481,7 @@ namespace System.Web.UI.WebControls
|
|
|
return dargs.ExceptionHandled;
|
|
|
}
|
|
|
|
|
|
- public void DeleteItem ()
|
|
|
+ public virtual void DeleteItem ()
|
|
|
{
|
|
|
currentEditRowKeys = DataKey.Values;
|
|
|
currentEditNewValues = GetRowValues (true, true);
|
|
|
@@ -1497,7 +1503,7 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- bool DeleteCallback (int recordsAffected, Exception exception)
|
|
|
+ bool DeleteCallback (int recordsAffected, Exception exception)
|
|
|
{
|
|
|
DetailsViewDeletedEventArgs dargs = new DetailsViewDeletedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditNewValues);
|
|
|
OnItemDeleted (dargs);
|
|
|
@@ -1529,7 +1535,7 @@ namespace System.Web.UI.WebControls
|
|
|
object bstate = base.SaveControlState ();
|
|
|
return new object[] {
|
|
|
bstate, pageIndex, pageCount, currentMode
|
|
|
- };
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
protected override void TrackViewState()
|
|
|
@@ -1624,12 +1630,13 @@ namespace System.Web.UI.WebControls
|
|
|
if (states[12] != null && oldEditValues != null) ((IStateManager)oldEditValues).LoadViewState (states[12]);
|
|
|
}
|
|
|
|
|
|
- string ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
|
|
|
+ void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
|
|
|
{
|
|
|
- return RaiseCallbackEvent (eventArgs);
|
|
|
+ RaiseCallbackEvent (eventArgs);
|
|
|
}
|
|
|
|
|
|
- protected virtual string RaiseCallbackEvent (string eventArgs)
|
|
|
+ string callbackResult;
|
|
|
+ protected virtual void RaiseCallbackEvent (string eventArgs)
|
|
|
{
|
|
|
string[] clientData = eventArgs.Split ('|');
|
|
|
pageIndex = int.Parse (clientData[0]);
|
|
|
@@ -1643,7 +1650,17 @@ namespace System.Web.UI.WebControls
|
|
|
|
|
|
HtmlTextWriter writer = new HtmlTextWriter (sw);
|
|
|
RenderGrid (writer);
|
|
|
- return sw.ToString ();
|
|
|
+ callbackResult = sw.ToString ();
|
|
|
+ }
|
|
|
+
|
|
|
+ string ICallbackEventHandler.GetCallbackResult ()
|
|
|
+ {
|
|
|
+ return GetCallbackResult ();
|
|
|
+ }
|
|
|
+
|
|
|
+ protected virtual string GetCallbackResult ()
|
|
|
+ {
|
|
|
+ return callbackResult;
|
|
|
}
|
|
|
|
|
|
[MonoTODO]
|
|
|
@@ -1684,7 +1701,7 @@ namespace System.Web.UI.WebControls
|
|
|
Page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script, true);
|
|
|
|
|
|
// Make sure the basic script infrastructure is rendered
|
|
|
- Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
|
|
|
+ Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
|
|
|
Page.ClientScript.GetPostBackClientHyperlink (this, "");
|
|
|
}
|
|
|
}
|
|
|
@@ -1703,21 +1720,21 @@ namespace System.Web.UI.WebControls
|
|
|
void RenderGrid (HtmlTextWriter writer)
|
|
|
{
|
|
|
switch (GridLines) {
|
|
|
- case GridLines.Horizontal:
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
- break;
|
|
|
- case GridLines.Vertical:
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
- break;
|
|
|
- case GridLines.Both:
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
- break;
|
|
|
- default:
|
|
|
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
|
|
|
- break;
|
|
|
+ case GridLines.Horizontal:
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
+ break;
|
|
|
+ case GridLines.Vertical:
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
+ break;
|
|
|
+ case GridLines.Both:
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0");
|
|
|
@@ -1727,21 +1744,21 @@ namespace System.Web.UI.WebControls
|
|
|
foreach (DetailsViewRow row in table.Rows)
|
|
|
{
|
|
|
switch (row.RowType) {
|
|
|
- case DataControlRowType.Header:
|
|
|
- if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
|
|
|
- break;
|
|
|
- case DataControlRowType.Footer:
|
|
|
- if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
|
|
|
- break;
|
|
|
- case DataControlRowType.Pager:
|
|
|
- if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
|
|
|
- break;
|
|
|
- case DataControlRowType.EmptyDataRow:
|
|
|
- if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
|
|
|
- break;
|
|
|
- default:
|
|
|
- if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
|
|
|
- break;
|
|
|
+ case DataControlRowType.Header:
|
|
|
+ if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
|
|
|
+ break;
|
|
|
+ case DataControlRowType.Footer:
|
|
|
+ if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
|
|
|
+ break;
|
|
|
+ case DataControlRowType.Pager:
|
|
|
+ if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
|
|
|
+ break;
|
|
|
+ case DataControlRowType.EmptyDataRow:
|
|
|
+ if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
if ((row.RowState & DataControlRowState.Alternate) != 0 && alternatingRowStyle != null)
|
|
|
@@ -1773,6 +1790,13 @@ namespace System.Web.UI.WebControls
|
|
|
}
|
|
|
table.RenderEndTag (writer);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ [MonoTODO]
|
|
|
+ PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)
|
|
|
+ {
|
|
|
+ throw new NotImplementedException ();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|