本文整理汇总了C#中SourceGrid类的典型用法代码示例。如果您正苦于以下问题:C# SourceGrid类的具体用法?C# SourceGrid怎么用?C# SourceGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceGrid类属于命名空间,在下文中一共展示了SourceGrid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ApplyCondition
public SourceGrid.Cells.ICellVirtual ApplyCondition(SourceGrid.Cells.ICellVirtual cell)
{
SourceGrid.Cells.ICellVirtual copied = cell.Copy();
copied.View = View;
return copied;
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:ConditionView.cs
示例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)
{
}
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:sgrdDataGrid.Columns.cs
示例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"])));
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:9,代码来源:SelectOutreachOption.ManualCode.cs
示例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;
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:9,代码来源:CellBackColorAlternate.cs
示例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);
}
}
开发者ID:distagon,项目名称:daemaged.ibnet,代码行数:10,代码来源:CellRenderers.cs
示例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;
}
开发者ID:wangjidilidun,项目名称:UIInterFace,代码行数:11,代码来源:DataEntryRules.cs
示例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();
}
}
}
}
开发者ID:Zeghs,项目名称:ZeroSystem,代码行数:13,代码来源:frmSignalViewer.cs
示例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();
}
开发者ID:liwei5946,项目名称:CEMS,代码行数:52,代码来源:EqstatusForm.cs
示例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;
}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:17,代码来源:frmSample51.cs
示例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;
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:19,代码来源:ConditionBuilder.cs
示例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;
}
开发者ID:vc,项目名称:from-editor,代码行数:19,代码来源:FRomColumnHeaderModel.cs
示例12: OnClick
public override void OnClick(SourceGrid.CellContext sender, EventArgs e)
{
this.G.SortRowsByCount();
}
开发者ID:knackwurst,项目名称:tvrename,代码行数:4,代码来源:ActorsGrid.cs
示例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();
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:14,代码来源:sgrdDataGridPaged.cs
示例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));
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:8,代码来源:frmSample26.cs
示例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));
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:frmSample26.cs
示例16: ConditionView
public ConditionView(SourceGrid.Cells.Views.IView view)
{
mView = view;
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:4,代码来源:ConditionView.cs
示例17: OnMouseDown
public override void OnMouseDown(SourceGrid.CellContext sender, MouseEventArgs e)
{
base.OnMouseDown (sender, e);
if (e.Button == MouseButtons.Right)
{
sender.StartEdit();
}
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:9,代码来源:frmSample42.cs
示例18: SetupAnalysisAttributeGrid
private void SetupAnalysisAttributeGrid(TSgrdDataGridPaged AGrid, ref SourceGrid.Cells.Editors.ComboBox AGridCombo)
{
AGrid.DataSource = null;
GLBatchTDS DS = null;
SourceGrid.Cells.Editors.ComboBox ATempCombo = null;
if (AGrid.Name == grdFromAnalAttributes.Name)
{
FTempFromDS = (GLBatchTDS)FMainDS.Clone();
DS = FTempFromDS;
}
else
{
DS = FMainDS;
}
if (AGrid.Columns.Count == 0)
{
ATempCombo = new SourceGrid.Cells.Editors.ComboBox(typeof(string));
ATempCombo.EnableEdit = true;
ATempCombo.EditableMode = EditableMode.Focus;
AGrid.Columns.Clear();
AGrid.AddTextColumn(Catalog.GetString("Type"), FMainDS.ATransAnalAttrib.ColumnAnalysisTypeCode, 99);
AGrid.AddTextColumn(Catalog.GetString("Value"),
DS.ATransAnalAttrib.Columns[ATransAnalAttribTable.GetAnalysisAttributeValueDBName()], 150,
ATempCombo);
}
FAnalysisAttributesLogic.SetTransAnalAttributeDefaultView(DS, true);
DS.ATransAnalAttrib.DefaultView.AllowNew = false;
AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(DS.ATransAnalAttrib.DefaultView);
AGrid.SetHeaderTooltip(0, Catalog.GetString("Type"));
AGrid.SetHeaderTooltip(1, Catalog.GetString("Value"));
AGrid.Selection.SelectionChanged += AnalysisAttributesGrid_RowSelected;
//Prepare Analysis attributes grid to highlight inactive analysis codes
// Create a cell view for special conditions
SourceGrid.Cells.Views.Cell strikeoutCell2 = new SourceGrid.Cells.Views.Cell();
strikeoutCell2.Font = new System.Drawing.Font(AGrid.Font, FontStyle.Strikeout);
// Create a condition, apply the view when true, and assign a delegate to handle it
SourceGrid.Conditions.ConditionView conditionAnalysisCodeActive = new SourceGrid.Conditions.ConditionView(strikeoutCell2);
conditionAnalysisCodeActive.EvaluateFunction = delegate(SourceGrid.DataGridColumn column2, int gridRow2, object itemRow2)
{
DataRowView row2 = (DataRowView)itemRow2;
string analysisCode = row2[ATransAnalAttribTable.ColumnAnalysisTypeCodeId].ToString();
if (AGrid.Name == grdFromAnalAttributes.Name)
{
return !FAnalysisAttributesLogic.AnalysisCodeIsActive(
FPreviouslySelectedAccountsRow[AGeneralLedgerMasterTable.GetAccountCodeDBName()].ToString(), FCacheDS.AAnalysisAttribute,
analysisCode);
}
return !FAnalysisAttributesLogic.AnalysisCodeIsActive(
cmbDetailAccountCode.GetSelectedString(), FCacheDS.AAnalysisAttribute, analysisCode);
};
// Create a condition, apply the view when true, and assign a delegate to handle it
SourceGrid.Conditions.ConditionView conditionAnalysisAttributeValueActive = new SourceGrid.Conditions.ConditionView(strikeoutCell2);
conditionAnalysisAttributeValueActive.EvaluateFunction = delegate(SourceGrid.DataGridColumn column2, int gridRow2, object itemRow2)
{
if (itemRow2 != null)
{
DataRowView row2 = (DataRowView)itemRow2;
string analysisCode = row2[ATransAnalAttribTable.ColumnAnalysisTypeCodeId].ToString();
string analysisAttributeValue = row2[ATransAnalAttribTable.ColumnAnalysisAttributeValueId].ToString();
return !TAnalysisAttributes.AnalysisAttributeValueIsActive(ref ATempCombo,
FCacheDS.AFreeformAnalysis,
analysisCode,
analysisAttributeValue);
}
else
{
return false;
}
};
//Add conditions to columns
int indexOfAnalysisCodeColumn = 0;
int indexOfAnalysisAttributeValueColumn = 1;
AGrid.Columns[indexOfAnalysisCodeColumn].Conditions.Add(conditionAnalysisCodeActive);
AGrid.Columns[indexOfAnalysisAttributeValueColumn].Conditions.Add(conditionAnalysisAttributeValueActive);
AGridCombo = ATempCombo;
}
开发者ID:js1987,项目名称:openpetragit,代码行数:88,代码来源:ReallocationJournalDialog.ManualCode.cs
示例19: FocusedRowChanged
private void FocusedRowChanged(System.Object sender, SourceGrid.RowEventArgs e)
{
FInChangeEvent = true;
DataRowView[] SelectedRows = grdTemplateList.SelectedDataRowsAsDataRowView;
if (SelectedRows.Length > 0)
{
GetDataFromControls();
FSelectedRow = (SReportTemplateRow)SelectedRows[0].Row;
txtDescription.Text = FSelectedRow.ReportVariant;
chkDefault.Checked = FSelectedRow.Default;
chkPrivate.Checked = FSelectedRow.Private;
chkPrivateDefault.Checked = FSelectedRow.PrivateDefault;
chkReadonly.Checked = FSelectedRow.Readonly;
}
else
{
FSelectedRow = null;
}
SetControlsVisible();
FInChangeEvent = false;
}
开发者ID:Davincier,项目名称:openpetra,代码行数:24,代码来源:MaintainTemplates.ManualCode.cs
示例20: LoadCategorySample
private void LoadCategorySample(string category, SourceGrid.Cells.Controllers.Button linkEvents, Type[] assemblyTypes, SourceGrid.Cells.Views.IView categoryView, SourceGrid.Cells.Views.IView headerView)
{
int row;
//Create Category Row
row = grid1.RowsCount;
grid1.Rows.Insert(row);
grid1[row, 0] = new SourceGrid.Cells.Cell(category);
grid1[row, 0].View = categoryView;
grid1[row, 0].ColumnSpan = grid1.ColumnsCount;
//Create Headers
row = grid1.RowsCount;
grid1.Rows.Insert(row);
SourceGrid.Cells.ColumnHeader header1 = new SourceGrid.Cells.ColumnHeader("Sample N°");
header1.View = headerView;
header1.AutomaticSortEnabled = false;
grid1[row, 0] = header1;
SourceGrid.Cells.ColumnHeader header2 = new SourceGrid.Cells.ColumnHeader("Description");
header2.View = headerView;
header2.AutomaticSortEnabled = false;
grid1[row, 1] = header2;
//Create Data Cells
for (int i = 0; i < assemblyTypes.Length; i++)
{
object[] attributes = assemblyTypes[i].GetCustomAttributes(typeof(SampleAttribute), true);
if (attributes != null && attributes.Length > 0)
{
SampleAttribute sampleAttribute = (SampleAttribute)attributes[0];
if (sampleAttribute.Category == category)
{
row = grid1.RowsCount;
grid1.Rows.Insert(row);
grid1[row, 0] = new SourceGrid.Cells.Cell( sampleAttribute.SampleNumber );
grid1[row, 0].View = new SourceGrid.Cells.Views.Cell();
grid1[row, 0].View.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
//Create a cell with a link
grid1[row, 1] = new SourceGrid.Cells.Link( sampleAttribute.Description );
grid1[row, 1].Tag = assemblyTypes[i];
grid1[row, 1].Controller.AddController(linkEvents);
}
}
}
//Enable sorting of the category range
SourceGrid.RangeLoader headerRange = new SourceGrid.RangeLoader(new SourceGrid.Range(header1.Range.Start.Row, 0, header1.Range.Start.Row, 1));
SourceGrid.RangeLoader rangeToSort = new SourceGrid.RangeLoader(new SourceGrid.Range(header1.Range.Start.Row+1, 0, row, 1));
SourceGrid.Cells.Controllers.SortableHeader sortableController = new SourceGrid.Cells.Controllers.SortableHeader(rangeToSort, headerRange);
header1.AddController(sortableController);
header1.Sort(true);
header2.AddController(sortableController);
}
开发者ID:reuxertz,项目名称:information-approach,代码行数:58,代码来源:StartForm.cs
注:本文中的SourceGrid类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论