本文整理汇总了C#中System.Web.UI.WebControls.BoundColumn.Set_Owner方法的典型用法代码示例。如果您正苦于以下问题:C# BoundColumn.Set_Owner方法的具体用法?C# BoundColumn.Set_Owner怎么用?C# BoundColumn.Set_Owner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.BoundColumn
的用法示例。
在下文中一共展示了BoundColumn.Set_Owner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPropertyToColumns
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);
}
示例2: LoadViewState
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
}