本文整理汇总了C#中GridControl.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# GridControl.Refresh方法的具体用法?C# GridControl.Refresh怎么用?C# GridControl.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridControl
的用法示例。
在下文中一共展示了GridControl.Refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SortCol
public void SortCol(int col, GridControl _grid)
{
if (_grid.CurrentCell.IsEditing)
_grid.CurrentCell.EndEdit();
GridStyleInfo style = new GridStyleInfo();
style.Tag = "";
//turn off the old sort arrow
for (int col1 = 1; col1 <= _grid.ColCount; ++col1)
if (col1 != col && _grid[0, col1].CellType == "ColumnHeaderCell")
{
_grid[0, col1].CellType = "Header";
break;
}
//turn on new sort arrow
_grid[0, col].CellType = "ColumnHeaderCell";
ListSortDirection dir = ListSortDirection.Ascending;
if (_grid[0, col].HasTag)
{
if ((ListSortDirection)_grid[0, col].Tag == ListSortDirection.Ascending)
dir = ListSortDirection.Descending;
}
_grid[0, col].Tag = dir;
if (col == 4) //formulacell
{
//need to use custom comparer to get at the
//formula computed value instead of the formul itself.
_grid.Data.SortByColumn(col, dir, new FormulaComparer());
}
else
{
_grid.Data.SortByColumn(col, dir);
}
GridFormulaEngine engine = ((GridFormulaCellModel)_grid.CellModels["FormulaCell"]).Engine;
engine.RecalculateRange(GridRangeInfo.Col(4), true, true);
_grid.Refresh();
}