本文整理汇总了C#中GridView.GetMasterRowExpanded方法的典型用法代码示例。如果您正苦于以下问题:C# GridView.GetMasterRowExpanded方法的具体用法?C# GridView.GetMasterRowExpanded怎么用?C# GridView.GetMasterRowExpanded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridView
的用法示例。
在下文中一共展示了GridView.GetMasterRowExpanded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshView
public static void RefreshView(GridView view)
{
try
{
if (((view.GridControl != null) && !view.GridControl.Disposing) && !view.GridControl.IsDisposed)
{
List<int> list = new List<int>();
for (int i = 0; i < view.RowCount; i++)
{
int visibleRowHandle = view.GetVisibleRowHandle(i);
if ((visibleRowHandle >= 0) && !view.GetMasterRowExpanded(visibleRowHandle))
{
EventLog.WriteLine("Row {0} is collapsed", new object[] { view.GetRow(visibleRowHandle) });
list.Add(view.GetRow(visibleRowHandle).GetHashCode());
}
}
view.RefreshData();
bool flag = false;
for (int j = 0; j < list.Count; j++)
{
for (int k = 0; k < view.RowCount; k++)
{
int rowHandle = view.GetVisibleRowHandle(k);
if (view.GetRow(rowHandle).GetHashCode() == list[j])
{
EventLog.WriteLine("Re-collapsing row {0}", new object[] { view.GetRow(rowHandle) });
view.CollapseMasterRow(k);
flag = true;
}
}
}
if (!view.IsFirstRow && (view.DetailLevel != 0))
{
view.MoveFirst();
flag = true;
}
if (flag)
{
view.Invalidate();
}
}
}
catch (Exception exception)
{
ErrorLog.WriteLine(exception);
}
}
示例2: SaveExpandedMasterRows
public void SaveExpandedMasterRows(GridView view)
{
if (view.GridControl.Views.Count == 1) return;
SaveMasterRowsList.Clear();
GridColumn column = view.Columns[descriptor.keyFieldName];
for (int i = 0; i < view.DataRowCount; i++)
if (view.GetMasterRowExpanded(i))
{
object key = view.GetRowCellValue(i, column);
SaveMasterRowsList.Add(key);
GridView detail = view.GetVisibleDetailView(i) as GridView;
if (detail != null)
{
ViewState state = ViewState.Create(this, detail);
if (state != null)
{
DetailViews.Add(key, state);
state.SaveState(detail);
}
}
}
}