Exemple #1
0
		void AddPropertyToColumns (PropertyDescriptor prop, bool tothis)
		{
			BoundColumn b = new BoundColumn ();
			b.Set_Owner (this);
			if (IsTrackingViewState) {
				IStateManager m = (IStateManager) b;
				m.TrackViewState ();
			}
			b.HeaderText = prop.Name;
			b.DataField = (tothis ? BoundColumn.thisExpr : prop.Name);
			b.SortExpression = prop.Name;
#if NET_2_0
			if (string.Compare (DataKeyField, b.DataField, StringComparison.InvariantCultureIgnoreCase) == 0) {
				b.ReadOnly = true;
			}
#endif
			DataSourceColumns.Add (b);
		}
Exemple #2
0
		protected override void LoadViewState (object savedState)
		{
			object [] pieces = savedState as object [];

			if (pieces == null)
				return;

			base.LoadViewState (pieces [0]);
			if (columns != null) {
				IStateManager cm = (IStateManager) columns;
				cm.LoadViewState (pieces [1]);
			}
			if (pieces [2] != null)
				PagerStyle.LoadViewState (pieces [2]);
			if (pieces [3] != null)
				HeaderStyle.LoadViewState (pieces [3]);
			if (pieces [4] != null)
				FooterStyle.LoadViewState (pieces [4]);
			if (pieces [5] != null)
				ItemStyle.LoadViewState (pieces [5]);
			if (pieces [6] != null)
				AlternatingItemStyle.LoadViewState (pieces [6]);
			if (pieces [7] != null)
				SelectedItemStyle.LoadViewState (pieces [7]);
			if (pieces [8] != null)
				EditItemStyle.LoadViewState (pieces [8]);

#if NET_2_0
			if (pieces [9] != null)
				ControlStyle.LoadViewState (pieces [8]);

			if (pieces [10] != null) {
				// IStateManager manager = (IStateManager) DataSourceColumns;
				// manager.LoadViewState (pieces [10]);
				object [] cols = (object []) pieces [10];
				foreach (object o in cols) {
					BoundColumn c = new BoundColumn ();
					((IStateManager) c).TrackViewState ();
					c.Set_Owner (this);
					((IStateManager) c).LoadViewState (o);
					DataSourceColumns.Add (c);
				}
			}
#else
			if (pieces [9] != null) {
				// IStateManager manager = (IStateManager) DataSourceColumns;
				// manager.LoadViewState (pieces [9]);
				object [] cols = (object []) pieces [9];
				foreach (object o in cols) {
					BoundColumn c = new BoundColumn ();
					c.Set_Owner (this);
					((IStateManager) c).LoadViewState (o);
					DataSourceColumns.Add (c);
				}
			}
#endif
		}
Exemple #3
0
		void AddPropertyToColumns ()
		{
			BoundColumn b = new BoundColumn ();
			if (IsTrackingViewState) {
				IStateManager m = (IStateManager) b;
				m.TrackViewState ();
			}
			b.Set_Owner (this);
			b.HeaderText = "Item";
			b.SortExpression = "Item";
			b.DataField  = BoundColumn.thisExpr;
			DataSourceColumns.Add (b);
		}