You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
@ -1375,44 +1375,44 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
}
|
||||
|
||||
protected override int CreateChildControls (IEnumerable data, bool dataBinding)
|
||||
protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
|
||||
{
|
||||
// clear GridView
|
||||
Controls.Clear ();
|
||||
table = null;
|
||||
rows = null;
|
||||
|
||||
if (data == null)
|
||||
if (dataSource == null)
|
||||
return 0;
|
||||
|
||||
PagedDataSource dataSource;
|
||||
PagedDataSource pagedDataSource;
|
||||
|
||||
if (dataBinding) {
|
||||
DataSourceView view = GetData ();
|
||||
dataSource = new PagedDataSource ();
|
||||
dataSource.DataSource = data;
|
||||
pagedDataSource = new PagedDataSource ();
|
||||
pagedDataSource.DataSource = dataSource;
|
||||
|
||||
if (AllowPaging) {
|
||||
dataSource.AllowPaging = true;
|
||||
dataSource.PageSize = PageSize;
|
||||
pagedDataSource.AllowPaging = true;
|
||||
pagedDataSource.PageSize = PageSize;
|
||||
if (view.CanPage) {
|
||||
dataSource.AllowServerPaging = true;
|
||||
pagedDataSource.AllowServerPaging = true;
|
||||
if (SelectArguments.RetrieveTotalRowCount)
|
||||
dataSource.VirtualCount = SelectArguments.TotalRowCount;
|
||||
pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
|
||||
}
|
||||
if (PageIndex >= dataSource.PageCount)
|
||||
pageIndex = dataSource.PageCount - 1;
|
||||
dataSource.CurrentPageIndex = PageIndex;
|
||||
if (PageIndex >= pagedDataSource.PageCount)
|
||||
pageIndex = pagedDataSource.PageCount - 1;
|
||||
pagedDataSource.CurrentPageIndex = PageIndex;
|
||||
}
|
||||
|
||||
PageCount = dataSource.PageCount;
|
||||
PageCount = pagedDataSource.PageCount;
|
||||
} else {
|
||||
dataSource = new PagedDataSource ();
|
||||
dataSource.DataSource = data;
|
||||
pagedDataSource = new PagedDataSource ();
|
||||
pagedDataSource.DataSource = dataSource;
|
||||
if (AllowPaging) {
|
||||
dataSource.AllowPaging = true;
|
||||
dataSource.PageSize = PageSize;
|
||||
dataSource.CurrentPageIndex = PageIndex;
|
||||
pagedDataSource.AllowPaging = true;
|
||||
pagedDataSource.PageSize = PageSize;
|
||||
pagedDataSource.CurrentPageIndex = PageIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1423,7 +1423,7 @@ namespace System.Web.UI.WebControls
|
||||
// Creates the set of fields to show
|
||||
|
||||
_dataEnumerator = null;
|
||||
ICollection fieldCollection = CreateColumns (dataSource, dataBinding);
|
||||
ICollection fieldCollection = CreateColumns (pagedDataSource, dataBinding);
|
||||
int fieldCount = fieldCollection.Count;
|
||||
DataControlField dcf;
|
||||
DataControlField[] fields = new DataControlField [fieldCount];
|
||||
@ -1443,7 +1443,7 @@ namespace System.Web.UI.WebControls
|
||||
enumerator = _dataEnumerator;
|
||||
skip_first = true;
|
||||
} else
|
||||
enumerator = dataSource.GetEnumerator ();
|
||||
enumerator = pagedDataSource.GetEnumerator ();
|
||||
|
||||
// Main table creation
|
||||
Table mainTable = ContainedTable;
|
||||
@ -1469,7 +1469,7 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
if (list.Count == 0) {
|
||||
if (createPager && (PagerSettings.Position == PagerPosition.Top || PagerSettings.Position == PagerPosition.TopAndBottom)) {
|
||||
topPagerRow = CreatePagerRow (fieldCount, dataSource);
|
||||
topPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
|
||||
OnRowCreated (new GridViewRowEventArgs (topPagerRow));
|
||||
mainTable.Rows.Add (topPagerRow);
|
||||
if (dataBinding) {
|
||||
@ -1527,7 +1527,7 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
if (createPager && (PagerSettings.Position == PagerPosition.Bottom || PagerSettings.Position == PagerPosition.TopAndBottom)) {
|
||||
bottomPagerRow = CreatePagerRow (fieldCount, dataSource);
|
||||
bottomPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
|
||||
OnRowCreated (new GridViewRowEventArgs (bottomPagerRow));
|
||||
mainTable.Rows.Add (bottomPagerRow);
|
||||
if (dataBinding) {
|
||||
@ -1545,7 +1545,7 @@ namespace System.Web.UI.WebControls
|
||||
return -1;
|
||||
|
||||
if (AllowPaging)
|
||||
return dataSource.DataSourceCount;
|
||||
return pagedDataSource.DataSourceCount;
|
||||
else
|
||||
return list.Count;
|
||||
}
|
||||
@ -1586,7 +1586,7 @@ namespace System.Web.UI.WebControls
|
||||
return row;
|
||||
}
|
||||
|
||||
protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource dataSource)
|
||||
protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)
|
||||
{
|
||||
TableCell cell = new TableCell ();
|
||||
if (columnSpan > 1)
|
||||
@ -1595,7 +1595,7 @@ namespace System.Web.UI.WebControls
|
||||
if (pagerTemplate != null)
|
||||
pagerTemplate.InstantiateIn (cell);
|
||||
else
|
||||
cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
|
||||
cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
|
||||
|
||||
row.Cells.Add (cell);
|
||||
}
|
||||
@ -1983,9 +1983,9 @@ namespace System.Web.UI.WebControls
|
||||
Sort (newSortExpression, newDirection);
|
||||
}
|
||||
|
||||
public virtual void Sort (string newSortExpression, SortDirection newSortDirection)
|
||||
public virtual void Sort (string sortExpression, SortDirection sortDirection)
|
||||
{
|
||||
GridViewSortEventArgs args = new GridViewSortEventArgs (newSortExpression, newSortDirection);
|
||||
GridViewSortEventArgs args = new GridViewSortEventArgs (sortExpression, sortDirection);
|
||||
OnSorting (args);
|
||||
if (args.Cancel)
|
||||
return;
|
||||
@ -2000,9 +2000,9 @@ namespace System.Web.UI.WebControls
|
||||
OnSorted (EventArgs.Empty);
|
||||
}
|
||||
public
|
||||
void SelectRow (int index)
|
||||
void SelectRow (int rowIndex)
|
||||
{
|
||||
GridViewSelectEventArgs args = new GridViewSelectEventArgs (index);
|
||||
GridViewSelectEventArgs args = new GridViewSelectEventArgs (rowIndex);
|
||||
OnSelectedIndexChanging (args);
|
||||
if (!args.Cancel) {
|
||||
RequireBinding ();
|
||||
@ -2011,9 +2011,9 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
}
|
||||
public
|
||||
void SetPageIndex (int newIndex)
|
||||
void SetPageIndex (int rowIndex)
|
||||
{
|
||||
GridViewPageEventArgs args = new GridViewPageEventArgs (newIndex);
|
||||
GridViewPageEventArgs args = new GridViewPageEventArgs (rowIndex);
|
||||
OnPageIndexChanging (args);
|
||||
|
||||
if (args.Cancel || !IsBoundUsingDataSourceID)
|
||||
@ -2024,9 +2024,9 @@ namespace System.Web.UI.WebControls
|
||||
OnPageIndexChanged (EventArgs.Empty);
|
||||
}
|
||||
public
|
||||
void SetEditRow (int index)
|
||||
void SetEditRow (int rowIndex)
|
||||
{
|
||||
GridViewEditEventArgs args = new GridViewEditEventArgs (index);
|
||||
GridViewEditEventArgs args = new GridViewEditEventArgs (rowIndex);
|
||||
OnRowEditing (args);
|
||||
|
||||
if (args.Cancel || !IsBoundUsingDataSourceID)
|
||||
@ -2134,11 +2134,11 @@ namespace System.Web.UI.WebControls
|
||||
currentEditNewValues = null;
|
||||
}
|
||||
|
||||
protected internal override void LoadControlState (object ob)
|
||||
protected internal override void LoadControlState (object savedState)
|
||||
{
|
||||
if (ob == null)
|
||||
if (savedState == null)
|
||||
return;
|
||||
object[] state = (object[]) ob;
|
||||
object[] state = (object[]) savedState;
|
||||
base.LoadControlState (state[0]);
|
||||
pageIndex = (int) state[1];
|
||||
selectedIndex = (int) state[2];
|
||||
@ -2351,14 +2351,14 @@ namespace System.Web.UI.WebControls
|
||||
((IStateManager)sortedDescendingHeaderStyle).LoadViewState (states [15]);
|
||||
}
|
||||
|
||||
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
|
||||
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
|
||||
{
|
||||
RaiseCallbackEvent (eventArgs);
|
||||
RaiseCallbackEvent (eventArgument);
|
||||
}
|
||||
|
||||
protected virtual void RaiseCallbackEvent (string eventArgs)
|
||||
protected virtual void RaiseCallbackEvent (string eventArgument)
|
||||
{
|
||||
string[] clientData = eventArgs.Split ('|');
|
||||
string[] clientData = eventArgument.Split ('|');
|
||||
PageIndex = int.Parse (clientData[0]);
|
||||
SortExpression = HttpUtility.UrlDecode (clientData [1]);
|
||||
SortDirection = (SortDirection) int.Parse (clientData [2]);
|
||||
@ -2384,18 +2384,18 @@ namespace System.Web.UI.WebControls
|
||||
return sw.ToString ();
|
||||
}
|
||||
|
||||
string ICallbackContainer.GetCallbackScript (IButtonControl control, string argument)
|
||||
string ICallbackContainer.GetCallbackScript (IButtonControl buttonControl, string argument)
|
||||
{
|
||||
return GetCallbackScript (control, argument);
|
||||
return GetCallbackScript (buttonControl, argument);
|
||||
}
|
||||
|
||||
protected virtual string GetCallbackScript (IButtonControl control, string argument)
|
||||
protected virtual string GetCallbackScript (IButtonControl buttonControl, string argument)
|
||||
{
|
||||
if (EnableSortingAndPagingCallbacks) {
|
||||
Page page = Page;
|
||||
if (page != null)
|
||||
page.ClientScript.RegisterForEventValidation (UniqueID, argument);
|
||||
return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + control.CommandName + "$" + control.CommandArgument + "\"); return false;";
|
||||
return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + buttonControl.CommandName + "$" + buttonControl.CommandArgument + "\"); return false;";
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user