本文整理汇总了C#中XPTable.Models.Row类的典型用法代码示例。如果您正苦于以下问题:C# Row类的具体用法?C# Row怎么用?C# Row使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Row类属于XPTable.Models命名空间,在下文中一共展示了Row类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoColspan
private void DoColspan()
{
Table table = this.table; // The Table control on a form - already initialised
table.SelectionStyle = SelectionStyle.Grid;
table.BeginUpdate();
table.EnableWordWrap = true; // If false, then Cell.WordWrap is ignored
table.GridLines = GridLines.Rows;
TextColumn col1 = new TextColumn("col A", 100);
TextColumn col2 = new TextColumn("col B", 100);
TextColumn col3 = new TextColumn("col C", 100);
table.ColumnModel = new ColumnModel(new Column[] { col1, col2, col3 });
TableModel model = new TableModel();
Row row;
Cell cell;
// Add all 3 cells for row 1
row = new Row();
row.Cells.Add(new Cell("Short 1a"));
//row1.Cells.Add(new Cell("Short 1"));
cell = new Cell("This is long text that will just be truncated");
row.Cells.Add(cell);
row.Cells.Add(new Cell("Short 1c"));
model.Rows.Add(row);
// Add only 2 cells for row 2
row = new Row();
row.Cells.Add(new Cell("Short 2a"));
cell = new Cell("This is text that will go over to the next column");
cell.ColSpan = 2; // The row height will be increased so we can see all the text
row.Cells.Add(cell);
// We don't add the next cell
model.Rows.Add(row);
// Add all 3 cells for row 3
row = new Row();
row.Cells.Add(new Cell("Short 3"));
//row1.Cells.Add(new Cell("Short 1"));
cell = new Cell("This is a cell with some really long text that wraps more than the other text");
cell.WordWrap = true; // The row height will be increased so we can see all the text
row.Cells.Add(cell);
row.Cells.Add(new Cell("Short 3c"));
model.Rows.Add(row);
// Add only 2 cells for row 4
row = new Row();
row.Cells.Add(new Cell("Short 4"));
cell = new Cell("This is a cell with some really long text that wraps more than the other text");
cell.WordWrap = true; // Colspan and Wordwrap!!
cell.ColSpan = 2;
row.Cells.Add(cell);
model.Rows.Add(row);
this.table.TableModel = model;
this.table.EndUpdate();
}
示例2: AddEmailRows
private void AddEmailRows(TableModel table, bool read, string from, string sent, string subject, string preview)
{
Row row = new Row();
row.Cells.Add(new Cell()); // always starts off showing all subrows
row.Cells.Add(new Cell("", read ? _read : _unread));
row.Cells.Add(new Cell(from));
row.Cells.Add(new Cell(DateTime.Parse(sent)));
row.Cells.Add(new Cell("hi"));
table.Rows.Add(row);
// Add a sub-row that shows just the email subject in grey (single line only)
Row subrow = new Row();
subrow.Cells.Add(new Cell()); // Extra column for +/-
subrow.Cells.Add(new Cell());
Cell cell = new Cell(subject);
cell.ForeColor = Color.Gray;
cell.ColSpan = 3;
subrow.Cells.Add(cell);
row.SubRows.Add(subrow);
// Add a sub-row that shows just a preview of the email body in blue, and wraps too
subrow = new Row();
subrow.Cells.Add(new Cell()); // Extra column for +/-
subrow.Cells.Add(new Cell());
cell = new Cell(preview);
cell.ForeColor = Color.Blue;
cell.ColSpan = 3;
cell.WordWrap = true;
subrow.Cells.Add(cell);
row.SubRows.Add(subrow);
}
示例3: CellCollection
/// <summary>
/// Initializes a new instance of the CellCollection class
/// that belongs to the specified Row
/// </summary>
/// <param name="owner">A Row representing the row that owns
/// the Cell collection</param>
public CellCollection(Row owner) : base()
{
if (owner == null)
{
throw new ArgumentNullException("owner");
}
this.owner = owner;
}
示例4: AddRow
private void AddRow(TableModel table, int index, double height, string text, string surname, string date, string more)
{
Row row = new Row();
row.Cells.Add(new Cell(index));
row.Cells.Add(new Cell(height));
row.Cells.Add(new Cell(text));
row.Cells.Add(new Cell(surname));
row.Cells.Add(new Cell(DateTime.Parse(date)));
row.Cells.Add(new Cell(more));
table.Rows.Add(row);
}
示例5: PlayerSkills_SkillChanged
void PlayerSkills_SkillChanged(object sender, SkillChangedEventArgs e)
{
int id = e.Value.ID;
if (id < 0)
throw new InternalErrorException("id < 0 in Skills.PlayerSkills_SkillChanged()");
Row row = null;
foreach (Row r in tableModel.Rows) {
if (id.Equals(r.Tag)) {
row = r;
break;
}
}
if (row == null) {
row = new Row();
row.Tag = id;
row.Cells.Add(new Cell());
row.Cells.Add(new Cell(id.ToString()));
row.Cells.Add(new Cell());
row.Cells.Add(new Cell());
row.Cells.Add(new Cell());
row.Cells.Add(new Cell());
row.Cells[0].Enabled = false;
if (id < DataFiles.Skills.Count) {
SkillData data = DataFiles.Skills[id];
row.Cells[1].Text = data.Name;
if (data.Action) {
row.Cells[0].Image = null;
row.Cells[0].Enabled = true;
}
}
tableModel.Rows.Add(row);
}
row.Cells[2].Data = (float)(e.Value.RealValue / 10.0f);
row.Cells[3].Data = (float)(e.Value.Value / 10.0f);
if (oldSkills.ContainsKey(id))
row.Cells[4].Data = (float)((e.Value.RealValue - oldSkills[id]) / 10.0f);
else {
row.Cells[4].Data = 0;
oldSkills.Add(id, e.Value.RealValue);
}
table.Sort();
}
示例6: DoWrap
private void DoWrap()
{
Table table = this.table; // The Table control on a form - already initialised
table.BeginUpdate();
table.EnableWordWrap = true; // If false, then Cell.WordWrap is ignored
table.SelectionStyle = SelectionStyle.Grid;
table.GridLines = GridLines.Rows;
TextColumn col1 = new TextColumn("col A", 100);
TextColumn col2 = new TextColumn("col B", 100);
table.ColumnModel = new ColumnModel(new Column[] { col1, col2 });
TableModel model = new TableModel();
Row row;
Cell cell;
row = new Row();
row.Cells.Add(new Cell("Short 1"));
//row1.Cells.Add(new Cell("Short 1"));
cell = new Cell("This is a cell with quite long text");
cell.WordWrap = true; // The row height will be increased so we can see all the text
row.Cells.Add(cell);
model.Rows.Add(row);
row = new Row();
row.Cells.Add(new Cell("Short 2"));
cell = new Cell("This is long text that will just be truncated");
cell.WordWrap = false; // Not needed - it is false by default
row.Cells.Add(cell);
model.Rows.Add(row);
row = new Row();
row.Cells.Add(new Cell("Short 3"));
//row1.Cells.Add(new Cell("Short 1"));
cell = new Cell("This is a cell with some really long text that wraps more than the other text");
cell.WordWrap = true; // The row height will be increased so we can see all the text
row.Cells.Add(cell);
model.Rows.Add(row);
row = new Row();
row.Cells.Add(new Cell("Short "));
cell = new Cell("This is long text that will just be truncated");
cell.WordWrap = false; // Not needed - it is false by default
row.Cells.Add(cell);
model.Rows.Add(row);
this.table.TableModel = model;
this.table.EndUpdate();
}
示例7: Add
/// <summary>
/// Adds the specified Row to the end of the collection
/// </summary>
/// <param name="row">The Row to add</param>
public int Add(Row row)
{
if (row == null)
{
throw new System.ArgumentNullException("Row is null");
}
int index = this.List.Add(row);
this.OnRowAdded(new TableModelEventArgs(this.owner, row, index, index));
return index;
}
示例8: AddEmailRows
private void AddEmailRows(TableModel table, bool read, string from, string sent, string subject, string preview)
{
Row row = new Row();
//row.Alignment = RowAlignment.Top;
row.Cells.Add(new Cell()); // always starts off showing all subrows
row.Cells.Add(new Cell("", read ? _read : _unread));
Cell fro = new Cell(null); //from);
fro.WordWrap = true;
row.Cells.Add(fro);
Cell cellSent = new Cell(DateTime.Parse(sent));
if (sent == "5/4/2007 9:13")
{
cellSent.CellStyle = new CellStyle(ColumnAlignment.Left);
cellSent.CellStyle.LineAlignment = RowAlignment.Top;
}
row.Cells.Add(cellSent);
row.Cells.Add(new Cell("hi"));
row.RowStyle = new XPTable.Models.RowStyle();
row.RowStyle.Alignment = RowAlignment.Top;
table.Rows.Add(row);
// Add a sub-row that shows just the email subject in grey (single line only)
Row subrow = new Row();
subrow.Cells.Add(new Cell()); // Extra column for +/-
subrow.Cells.Add(new Cell());
subrow.RowStyle = new XPTable.Models.RowStyle();
subrow.RowStyle.Alignment = RowAlignment.Bottom;
Cell cell = new Cell(subject);
cell.ForeColor = Color.Gray;
cell.ColSpan = 3;
subrow.Cells.Add(cell);
row.SubRows.Add(subrow);
// Add a sub-row that shows just a preview of the email body in blue, and wraps too
subrow = new Row();
subrow.Cells.Add(new Cell()); // Extra column for +/-
subrow.Cells.Add(new Cell());
cell = new Cell(preview);
cell.ForeColor = Color.Blue;
cell.ColSpan = 3;
cell.WordWrap = true;
subrow.RowStyle = new XPTable.Models.RowStyle();
subrow.RowStyle.Alignment = RowAlignment.Bottom;
subrow.Cells.Add(cell);
row.SubRows.Add(subrow);
}
示例9: DoControl
private void DoControl()
{
Table table = this.table; // The Table control on a form - already initialised
table.SelectionStyle = SelectionStyle.Grid;
table.BeginUpdate();
table.EnableWordWrap = true; // If false, then Cell.WordWrap is ignored
table.GridLines = GridLines.None;
TextColumn col1 = new TextColumn("From", 200);
ControlColumn col2 = new ControlColumn(30);
col2.Alignment = ColumnAlignment.Right;
SpinnerFactory fact = new SpinnerFactory();
//fact.ClickEventHandler = new EventHandler(circle_Click);
col2.ControlFactory = fact;
col2.ControlSize = new Size(25, 25);
col2.Alignment = ColumnAlignment.Center;
ControlColumn col3 = new ControlColumn(100);
col3.Alignment = ColumnAlignment.Right;
col3.ControlFactory = new TextBoxFactory();
table.ColumnModel = new ColumnModel(new Column[] { col1, col2, col3 });
TableModel model = new TableModel();
model.RowHeight = 25; // Change the height of all rows so the control can be seen
Row row;
row = new Row();
row.Cells.Add(new Cell("Text"));
row.Cells.Add(new Cell(Color.Red)); // The .Data property is picked up as the colour in the SpinnerFactory
row.Cells.Add(new Cell("Apples")); // The .Text property is picked up in the text in the TextboxFactory
model.Rows.Add(row);
row = new Row();
row.Cells.Add(new Cell("More"));
row.Cells.Add(new Cell());
row.Cells.Add(new Cell("Pears"));
model.Rows.Add(row);
this.table.TableModel = model;
//this.table.CellClick += new XPTable.Events.CellMouseEventHandler(table_CellClick);
this.table.EndUpdate();
}
示例10: AddColumns
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public void AddColumns(ColumnModel model)
{
this.model = model;
CellStyle cellStyle = new CellStyle();
cellStyle.Padding = new CellPadding(6, 0, 0, 0);
this.columnTable.BeginUpdate();
for (int i=0; i<model.Columns.Count; i++)
{
Row row = new Row();
Cell cell = new Cell(model.Columns[i].Text, model.Columns[i].Visible);
cell.Tag = model.Columns[i].Width;
cell.CellStyle = cellStyle;
row.Cells.Add(cell);
this.columnTable.TableModel.Rows.Add(row);
}
this.columnTable.SelectionChanged += new Events.SelectionEventHandler(OnSelectionChanged);
this.columnTable.CellCheckChanged += new Events.CellCheckBoxEventHandler(OnCellCheckChanged);
if (this.columnTable.VScroll)
{
this.columnTable.ColumnModel.Columns[0].Width -= SystemInformation.VerticalScrollBarWidth;
}
if (this.columnTable.TableModel.Rows.Count > 0)
{
this.columnTable.TableModel.Selections.SelectCell(0, 0);
this.showButton.Enabled = !this.model.Columns[0].Visible;
this.hideButton.Enabled = this.model.Columns[0].Visible;
this.widthTextBox.Text = this.model.Columns[0].Width.ToString();
}
this.columnTable.EndUpdate();
}
示例11: Init
public void Init()
{
DataSet TypeSalary = DayType.GetTypeSalary();
tblTypeSalary.TableModel.Rows.Clear();
int STT =0;
if (TypeSalary != null)
{
if(TypeSalary.Tables.Count > 0)
{
foreach (DataRow r in TypeSalary.Tables[0].Rows)
{
STT += 1;
Row row = new Row(new string[] { STT.ToString(),r["SalaryName"].ToString(),r["SalaryDescription"].ToString(),r["ContractName"].ToString(),r["SalaryBasic"].ToString(),r["SalaryID"].ToString()});
tblTypeSalary.TableModel.Rows.Add(row);
}
}
}
}
示例12: LoadEmployeeeInDepartment
/// <summary>
/// Dien thong tin nhan vien un'g voi' phong duoc chon
/// </summary>
private void LoadEmployeeeInDepartment()
{
// dsLunch = lunchDO.GetLunch((int)departmentTreeView.SelectedNode.Tag, dtpWorkingDay.Value.Date);
dsEmployee = employeeDO.GetEmployeeByDepartment((int)departmentTreeView.SelectedNode.Tag);
// LunchDataRows = dsLunch.Tables[0].Select(dataFilter, dataSort);
lvwListEmployee.BeginUpdate();
lvwListEmployee.TableModel.Rows.Clear();
int STT = 0;
foreach (DataRow dr in dsEmployee.Tables[0].Rows)
{
string CardID = dr["CardID"].ToString();
string EmployeeName = dr["EmployeeName"].ToString();
string EmployeeID = dr["EmployeeID"].ToString();
Cell[] cells = new Cell[4];
cells[0] = new Cell(STT + 1);
cells[1] = new Cell(CardID);
cells[2] = new Cell(EmployeeName);
cells[3] = new Cell(EmployeeID);
Row row = new Row(cells);
row.Tag = STT;
lvwListEmployee.TableModel.Rows.Add(row);
STT++;
}
lvwListEmployee.EndUpdate();
}
示例13: LoadFrameList
private void LoadFrameList()
{
tableFrames.TableModel.Rows.Clear();
AnimationInfo selectedAnim = this.SelectedAnimationInfo;
if (selectedAnim != null)
{
for (int i = 0; i < selectedAnim.AnimationFrames.Count; i++)
{
AnimationFrame frame = selectedAnim.AnimationFrames[i];
Cell[] cells = new Cell[2];
cells[0] = new Cell(frame.Area);
cells[1] = new Cell((object)frame.Duration);
Row newRow = new Row(cells);
tableFrames.TableModel.Rows.Add(newRow);
}
tableFrames.TableModel.Selections.AddCell(0, 1);
}
}
示例14: PopulateListInsuranInYear
private void PopulateListInsuranInYear()
{
dsInsurance = insuranceDO.GetListInsuranceInYear(int.Parse(cboYear.Text));
lvwListInsurance.BeginUpdate();
lvwListInsurance.TableModel.Rows.Clear();
int STT = 0;
foreach (DataRow dr in dsInsurance.Tables[0].Rows)
{
String StartDate = DateTime.Parse(dr["StartPointDate"].ToString()).ToString("dd/MM/yyyy");
String EndDate = DateTime.Parse(dr["EndPointDate"].ToString()).ToString("dd/MM/yyyy");
Cell[] listInusurance = new Cell[3];
listInusurance[0]= new Cell((STT+1).ToString());
listInusurance[1]= new Cell(StartDate);
listInusurance[2]= new Cell(EndDate);
Row row = new Row(listInusurance);
row.Tag = STT;
lvwListInsurance.TableModel.Rows.Add(row);
STT ++;
}
lvwListInsurance.EndUpdate();
}
示例15: DeleteRow
private void DeleteRow(Row row)
{
//DialogResult res = MessageBox.Show(String.Format("Do you really want to remove mask {0}?", row.Cells[0].Text), "Delete item", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
//if (res != DialogResult.OK) return;
int index = row.Index;
TableModel.Rows.RemoveAt(index);
if (TableModel.Rows.Count <= index && index > 0) index--;
TableModel.Selections.SelectCells(index, 0, index, 2);
if (Changed != null) Changed(this, null);
}