本文整理汇总了C#中SourceGrid类的典型用法代码示例。如果您正苦于以下问题:C# SourceGrid类的具体用法?C# SourceGrid怎么用?C# SourceGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceGrid类属于命名空间,在下文中一共展示了SourceGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyCondition
public SourceGrid.Cells.ICellVirtual ApplyCondition(SourceGrid.Cells.ICellVirtual cell)
{
SourceGrid.Cells.ICellVirtual copied = cell.Copy();
copied.View = View;
return copied;
}
示例2: TSgrdTextColumn
/// <summary>
/// constructor
/// </summary>
/// <param name="ADataGrid"></param>
/// <param name="ADataColumn"></param>
/// <param name="ACaption"></param>
/// <param name="ADataCell"></param>
public TSgrdTextColumn(SourceGrid.DataGrid ADataGrid,
System.Data.DataColumn ADataColumn,
string ACaption,
SourceGrid.Cells.ICellVirtual ADataCell) :
this(ADataGrid, ADataColumn, ACaption, ADataCell, -1, true)
{
}
示例3: grdOutreachOptionDoubleClick
private void grdOutreachOptionDoubleClick(System.Object sender, SourceGrid.CellContextEventArgs e)
{
int Row = e.CellContext.Position.Row;
if (Row >= 0)
{
FUnitTable.DefaultView[Row]["Is Selected"] = (System.Object)((!(Boolean)(FUnitTable.DefaultView[Row]["Is Selected"])));
}
}
示例4: PrepareView
protected override void PrepareView(SourceGrid.CellContext context)
{
base.PrepareView(context);
if (Math.IEEERemainder(context.Position.Row, 2) == 0)
Background = FirstBackground;
else
Background = SecondBackground;
}
示例5: OnMouseUp
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e)
{
base.OnMouseUp(sender, e);
if (e.Button == MouseButtons.Right)
{
sender.Grid.Selection.ResetSelection(true);
sender.Grid.Selection.SelectRow(sender.CellRange.Start.Row, true);
}
}
示例6: JudgeVeticalColumnNull
public bool JudgeVeticalColumnNull(SourceGrid.Grid grid, int nIndexColumn)
{
for (int r = grid.FixedRows; r < grid.RowsCount; r++)
{
if (grid[r, nIndexColumn].Value != null)
{
return false;
}
}
return true;
}
示例7: RefreshGrid
private void RefreshGrid(SourceGrid.DataGrid grid, AbstractBoundList<_TradeInfo> source) {
if (!this.IsDisposed) {
if (grid.Visible) {
if (grid.InvokeRequired) {
grid.Invoke((MethodInvoker) delegate {
source.Refresh();
});
} else {
source.Refresh();
}
}
}
}
示例8: BindSourceGrid
/// <summary>
/// 为SourceGrid绑定数据源
/// </summary>
/// <param name="grid"></param>
/// <param name="data"></param>
public void BindSourceGrid(SourceGrid.Grid grid, DataTable data, string colName)
{
int[] ColumnWidth = new int[] { 40, 200};
//PopupMenu menuController = new PopupMenu();
if (grid.RowsCount > 0)
{
//清除原表格内容
grid.Rows.RemoveRange(0, grid.RowsCount);
}
grid.SelectionMode = SourceGrid.GridSelectionMode.Row;//选行模式
grid.Selection.EnableMultiSelection = false; //行不允许多选
grid.BorderStyle = BorderStyle.FixedSingle;
grid.ColumnsCount = 2;
grid.FixedRows = 1;
BuildGridColumnWidth(grid, ColumnWidth);
grid.Rows.Insert(0);
grid[0, 0] = new SourceGrid.Cells.ColumnHeader("ID");
grid[0, 1] = new SourceGrid.Cells.ColumnHeader(colName);
grid[0, 1].View.Font = new Font("宋体", 10, FontStyle.Bold);
//隐藏列
grid[0, 0].Column.Visible = false;
grid[0, 0].View.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
for (int i = 1; i < data.Rows.Count + 1; i++)
{
grid.Rows.Insert(i);
//设置行高
grid.Rows.SetHeight(i, 30);
#region 表体塞值
//表体塞值
grid[i, 0] = new SourceGrid.Cells.Cell(data.Rows[i - 1][0], typeof(int)); //id
grid[i, 1] = new SourceGrid.Cells.Cell(data.Rows[i - 1][1], typeof(string));//名称
#endregion
//设置单元格不可编辑
grid[i, 0].Editor.EnableEdit = false;
grid[i, 1].Editor.EnableEdit = false;
}
grid.Refresh();
}
示例9: OnValueChanged
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
{
base.OnValueChanged(sender, e);
//I use the OnValueChanged to link the value of 2 cells
// changing the value of the other cell
SourceGrid.Position otherCell = new SourceGrid.Position(sender.Position.Row, mDependencyColumn);
SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell);
object newVal = sender.Value;
if (ConvertFunction != null)
newVal = ConvertFunction(newVal);
if (!object.Equals(otherContext.Value, newVal))
otherContext.Value = newVal;
}
示例10: AlternateView
public static SourceGrid.Conditions.ICondition AlternateView(
SourceGrid.Cells.Views.IView view,
System.Drawing.Color alternateBackcolor,
System.Drawing.Color alternateForecolor)
{
SourceGrid.Cells.Views.IView viewAlternate = (SourceGrid.Cells.Views.IView)view.Clone();
viewAlternate.BackColor = alternateBackcolor;
viewAlternate.ForeColor = alternateForecolor;
SourceGrid.Conditions.ConditionView condition =
new SourceGrid.Conditions.ConditionView(viewAlternate);
condition.EvaluateFunction = delegate(SourceGrid.DataGridColumn column, int gridRow, object itemRow)
{
return (gridRow & 1) == 1;
};
return condition;
}
示例11: GetValue
public virtual object GetValue(SourceGrid.CellContext cellContext)
{
AddressInstance adr = (cellContext.Grid as FRomGrid).DataSource.Address;
//Порядковый номер с нуля
int n = cellContext.Position.Column - cellContext.Grid.FixedColumns;
//Если фиксированных больше одной и сейчас проходим по первой,
//заполняем ее порядковым номером
if (cellContext.Grid.FixedRows > 1 && cellContext.Position.Row == 0)
return n + 1;
if (adr.XMapConstName.Length != 0)
{
From f = (cellContext.Grid as FRomGrid).DataSource.GetFRom();
return f.GetMap(adr.XMapConstName)[n, 0, ViewEnum.Scale];
}
else
return n + 1;
}
示例12: OnClick
public override void OnClick(SourceGrid.CellContext sender, EventArgs e)
{
this.G.SortRowsByCount();
}
示例13: OnSortingRangeRows
/// <summary>
/// when sorting
/// </summary>
/// <param name="e"></param>
protected override void OnSortingRangeRows(SourceGrid.SortRangeRowsEventArgs e)
{
base.OnSortingRangeRows(e);
if (!FPerformFullLoadOnDataGridSort)
{
FPerformFullLoadOnDataGridSort = true;
LoadAllDataPages();
}
}
示例14: OnValueChanged
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
{
base.OnValueChanged(sender, e);
string val = "Value of cell {0} is '{1}'";
MessageBox.Show(sender.Grid, string.Format(val, sender.Position, sender.Value));
}
示例15: OnMouseUp
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e)
{
base.OnMouseUp (sender, e);
if (e.Button == MouseButtons.Right)
menu.Show(sender.Grid, new Point(e.X, e.Y));
}