Browse Source

2002-08-08 Gaurav Vaish <[email protected]>

* DataGrid.cs                 - Added private method
                                CreatePagedDataSource
                              - Started work on
                                CreateControlHierarchy(bool)
* PagedDataSource.cs          - Bug fixed.
                                CurrentPageIndex is writable.

svn path=/trunk/mcs/; revision=6536
Gaurav Vaish 23 years ago
parent
commit
cbb727d8dc

+ 9 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,12 @@
+2002-08-08      Gaurav Vaish <[email protected]>
+
+	* DataGrid.cs                 - Added private method
+	                                CreatePagedDataSource
+	                              - Started work on
+	                                CreateControlHierarchy(bool)
+	* PagedDataSource.cs          - Bug fixed.
+	                                CurrentPageIndex is writable.
+
 2002-08-07  Gonzalo Paniagua Javier <[email protected]>
 
 	* DataGrid.cs: fixed typo.

+ 62 - 0
mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs

@@ -933,9 +933,71 @@ namespace System.Web.UI.WebControls
 		[MonoTODO]
 		protected override void CreateControlHierarchy(bool useDataSource)
 		{
+			IEnumerator pageSource;
+			int         itemCount;
+			int         dsItemCount;
+			ArrayList   dataKeys;
+			ArrayList   columns;
+			IEnumerable resolvedDS;
+			ICollection collResolvedDS;
+			int         pageDSCount;
+			int         colCount;
+			DataGridColumn[] cols;
+			Table       deployTable;
+			TableRowCollection deployRows;
+			ListItemType deployType;
+			int         indexCounter;
+			string      dkField;
+			bool        dsUse;
+			bool        pgEnabled;
+			int         editIndex;
+			int         selIndex;
+
+			pagedDataSource = CreatePagedDataSource();
+			pageSource      = null;
+			itemCount       = -1;
+			dsItemCount     = -1;
+			dataKeys        = DataKeysArray;
+			columns         = null;
+			if(itemsArrayList != null)
+			{
+				itemsArrayList.Clear();
+			} else
+			{
+				itemsArrayList = new ArrayList();
+			}
+			if(!useDataSource)
+			{
+				itemCount    = (int) ViewState["_DataGrid_ItemCount"];
+				pageDSCount  = (int) ViewState["_DataGrid_DataSource_Count"];
+				if(itemCount != -1)
+				{
+					if(pagedDataSource.IsCustomPagingEnabled)
+					{
+						// I may need a dummy pagedDS
+					}
+				}
+			} else
+			{
+				//TODO: Use Data Source
+			}
 			throw new NotImplementedException();
 		}
 
+		private PagedDataSource CreatePagedDataSource()
+		{
+			PagedDataSource retVal;
+
+			retVal = new PagedDataSource();
+			retVal.CurrentPageIndex = CurrentPageIndex;
+			retVal.PageSize         = PageSize;
+			retVal.AllowPaging      = AllowPaging;
+			retVal.AllowCustomPaging = AllowCustomPaging;
+			retVal.VirtualCount      = VirtualItemCount;
+
+			return retVal;
+		}
+
 		internal void OnColumnsChanged()
 		{
 		}