本文整理汇总了C#中TableRow.AddCell方法的典型用法代码示例。如果您正苦于以下问题:C# TableRow.AddCell方法的具体用法?C# TableRow.AddCell怎么用?C# TableRow.AddCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableRow
的用法示例。
在下文中一共展示了TableRow.AddCell方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadTableData
public override bool LoadTableData (TableDescription TableDataContent)
{
TableDataContent.NameID = "Personen " + NameID;
TableDataContent.HeadLine = String.Format ("Wahlberechtigte mit den Familiennamen von {0} ", NameID);
int RunningRowIndex = 0;
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Block" });
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Stiege" });
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Stock/Türe" });
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Name" });
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Vorname" });
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Anz.Chips" });
foreach (WahlberechtigtInStiege RowEntry in ItemsSource)
{
TableRow NewRow = new TableRow();
NewRow.FirstCellIsRowHeader = true;
NewRow.AddCell(new TableCell() { Text = RowEntry.Block });
NewRow.AddCell(new TableCell() { Text = RowEntry.Stiege });
NewRow.AddCell(new TableCell() { Text = RowEntry.StockTuere });
NewRow.AddCell(new TableCell() { Text = RowEntry.Name });
NewRow.AddCell(new TableCell() { Text = RowEntry.Vorname });
NewRow.AddCell(new TableCell() { Text = Convert.ToString(RowEntry.NumberOfFamilyMember) });
TableDataContent.Rows.AddRow (NewRow);
}
return true;
}
示例2: LoadTableData
public override bool LoadTableData(TableDescription TableDataContent)
{
TableDataContent.NameID = "Wahlberechtigte " + NameID;
TableDataContent.HeadLine = String.Format("Wahlberechtigte {0} ", NameID);
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = String.Empty });
foreach (String KurzWahlBezeichnung in Years)
{
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = KurzWahlBezeichnung });
}
foreach (WahlberechtigtSummen RowEntry in ItemsSource)
{
TableRow NewRow = new TableRow();
NewRow.FirstCellIsRowHeader = true;
NewRow.AddCell(new TableCell() { Text = Convert.ToString (RowEntry.Block) });
foreach (WahlberechtigtSummen WahlEntry in RowEntry.WahlberechtigtJeVergleichsWahl)
{
NewRow.AddCell(new TableCell() { Text = Convert.ToString(WahlEntry.NumberOfChips) });
}
TableDataContent.Rows.AddRow(NewRow);
}
return true;
}
示例3: CreateAttributeRow
private TableRow CreateAttributeRow(string concept, string code, string codeDesc, bool highlighted = false)
{
TableRow tr = new TableRow();
if (highlighted) tr.AddClass(HtmlClasses.ExtraInfoTableRowHighlighted);
TableCell cell_concept = new TableCell(concept);
cell_concept.AddClass(HtmlClasses.ExtraInfoTableLabelConcept);
TableCell cell_concept_value = new TableCell(string.Format("[{0}] - {1}", code, codeDesc));
cell_concept_value.AddClass(HtmlClasses.ExtraInfoTableLabelConceptValue);
tr.AddCell(cell_concept);
tr.AddCell(cell_concept_value);
return tr;
}
示例4: AddVerticalKeyValues
/// <summary>
/// Add vertical key values to the specified output Row
/// </summary>
/// <param name="verticalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddVerticalKeyValues(
IDictionary<string, TableCell> verticalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model,
IDataReader currentRow)
{
this._uniqID++;
Table tb = new Table();
TableRow _rw = new TableRow();
Table tb_extra = (this._useSdmxAttr) ? CreateDimensionAttributeTable(dimension, model, currentRow) : null;
if (tb_extra != null)
{
tb_extra.AddAttribute("ID", this._uniqID + "_dim_info_extra_dialog");
tb_extra.AddClass(HtmlClasses.ExtraInfoTable);
tb.AddRow(new TableRow(new TableCell(tb_extra)));
var tb_btn_extra = new TableCell();
tb_btn_extra.AddClass(HtmlClasses.ExtraInfoWrapper);
tb_btn_extra.AddAttribute("ID", this._uniqID + "_dim_info");
_rw.AddCell(tb_btn_extra);
}
string text = this.GetLocalizedName(dimension, currentValue);
var tb_dim = new TableCell();
tb_dim.AddClass(HtmlClasses.VerticalKeyValue);
if (dimension == "TIME_PERIOD") tb_dim.AddAttribute("style", "white-space:nowrap");
tb_dim.SetupDisplayText(currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
_rw.AddCell(tb_dim);
tb.AddRow(_rw);
TableCell tb_cell = new TableCell(tb);
outputRow.AddCell(tb_cell);
verticalPreviousValues[dimension] = tb_cell;
}
示例5: AddHorrizontalKeyValues
/// <summary>
/// Add horrizontal key values to the specified output Row
/// </summary>
/// <param name="horizontalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddHorrizontalKeyValues(
IDictionary<string, TableCell> horizontalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model,
IDataReader currentRow)
{
TableCell oldCell;
horizontalPreviousValues.TryGetValue(dimension, out oldCell);
string oldValue = string.Empty;
if (oldCell != null &&
oldCell.Children.Count > 0 &&
oldCell.Children[0].Children.Count > 0 &&
oldCell.Children[0].Children[0].Children.Count > 1)
oldValue = oldCell.Children[0].Children[0].Children[0].SdmxValue;
else if (oldCell != null)
oldValue = oldCell.SdmxValue;
if (oldCell != null && string.Equals(currentValue, oldValue))
{
oldCell.ColumnSpan++;
}
else
{
this._uniqID++;
Table tb = new Table();
TableRow _rw = new TableRow();
Table tb_extra = (this._useSdmxAttr) ? CreateDimensionAttributeTable(dimension, model, currentRow) : null;
if (tb_extra != null)
{
tb_extra.AddAttribute("ID", this._uniqID + "_dim_info_extra_dialog");
tb_extra.AddClass(HtmlClasses.ExtraInfoTable);
tb.AddRow(new TableRow(new TableCell(tb_extra)));
var tb_btn_extra = new TableCell();
tb_btn_extra.AddClass(HtmlClasses.ExtraInfoWrapper);
tb_btn_extra.AddAttribute("ID", this._uniqID + "_dim_info");
_rw.AddCell(tb_btn_extra);
}
string text = this.GetLocalizedName(dimension, currentValue);
var tb_dim = new TableCell();
tb_dim.AddClass(HtmlClasses.HorizontalKeyValue);
tb_dim.SetupDisplayText(currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
if (dimension == "TIME_PERIOD") tb_dim.AddAttribute("style", "white-space:nowrap");
_rw.AddCell(tb_dim);
tb.AddRow(_rw);
TableCell tb_cell = new TableCell(tb);
tb_cell.SdmxValue = currentValue;
outputRow.AddCell(tb_cell);
horizontalPreviousValues[dimension] = tb_cell;
}
}
示例6: ParseDataRow
//.........这里部分代码省略.........
int currentVerticalKeyValueCount = state.CurrentTableRow.Children.Count;
state.VerticalKeyValueCount.Add(state.VerticalCurrentKeySet, currentVerticalKeyValueCount);
state.CurrentVerticalKeyValueCount = currentVerticalKeyValueCount;
for (int i = 0; i < state.CurrentHorizontalKeySetColumn; i++)
{
TableCell emptyMeasure = new TableCell("-");
emptyMeasure.AddClass(HtmlClasses.NotMeasure);
state.CurrentTableRow.AddElement(emptyMeasure);
}
}
else
{
state.CurrentTableRow = currentRow;
state.CurrentVerticalKeyValueCount = state.VerticalKeyValueCount[state.VerticalCurrentKeySet];
}
//var time = state.InputRow[state.Model.KeyFamily.TimeDimension.Id] as string;
NumberStyles style;
style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands | NumberStyles.AllowLeadingSign;
var val = state.InputRow[state.Model.KeyFamily.PrimaryMeasure.Id] as string;
if (string.IsNullOrEmpty(val)
|| val == "NaN")
{
val = string.Empty;
}
else {
decimal decVal = 0;
Int32 intVal = 0;
if (Int32.TryParse(val.ToString(), out intVal))
{
val = intVal.ToString();
}
else if (decimal.TryParse(val.ToString(), style, cFrom, out decVal))
{
val = decVal.ToString("F1", cTo);
}
}
TableCell data_cell;
if (string.IsNullOrEmpty(val))
{
data_cell = new TableCell("-");
data_cell.AddClass(HtmlClasses.NotMeasure);
}else{
this._uniqID++;
Table tb = new Table();
TableRow _rw = new TableRow();
// Add table info extra at level observation
Table tb_extra =
(this._useSdmxAttr) ?
(!string.IsNullOrEmpty(val)) ?
CreateObservationAttribute(state.Model, state.InputRow) : null : null;
if (tb_extra != null)
{
tb_extra.AddAttribute("ID", this._uniqID + "_info_extra_dialog");
tb_extra.AddClass(HtmlClasses.ExtraInfoTable);
tb.AddRow(new TableRow(new TableCell(tb_extra)));
var tb_btn_extra = new TableCell();
tb_btn_extra.AddClass(HtmlClasses.ExtraInfoWrapper);
tb_btn_extra.AddAttribute("ID", this._uniqID + "_info");
_rw.AddCell(tb_btn_extra);
}
/*
decimal decVal_vc = 0;
if (vc != null && decimal.TryParse(vc.ToString(), NumberStyles.AllowDecimalPoint, cFrom, out decVal_vc))
{
vc = decVal_vc.ToString("F1", cTo);
}
decimal decVal_vt = 0;
if (vt != null && decimal.TryParse(vt.ToString(), NumberStyles.AllowDecimalPoint, cFrom, out decVal_vt))
{
vt = decVal_vt.ToString("F1", cTo);
}
*/
TableCell measure = new TableCell((string.IsNullOrEmpty(val)) ? "-" : val);
measure.AddClass((string.IsNullOrEmpty(val)) ? HtmlClasses.NotMeasure : HtmlClasses.Measure);
measure.AddAttribute("data-v", (string.IsNullOrEmpty(val)) ? "-" : val);
measure.AddAttribute("data-vc", (vc == null) ? "?" : vc.ToString());
measure.AddAttribute("data-vt", (vt == null) ? "?" : vt.ToString());
_rw.AddCell(measure);
tb.AddRow(_rw);
data_cell = new TableCell(tb);
data_cell.AddClass(HtmlClasses.ExtraInfoTableValue);
}
int column = state.CurrentHorizontalKeySetColumn + state.CurrentVerticalKeyValueCount;
state.CurrentTableRow.AddAt(data_cell, column);
}
示例7: CreateHorizontalTitles
/// <summary>
/// Create and setup the titles for horizontal dimensions
/// </summary>
/// <param name="model">
/// The DataSetModel to use
/// </param>
/// <param name="horizontalRows">
/// The horizontal map to add the titles to
/// </param>
/// <param name="horizontalOrderedRows">
/// The list of rows
/// </param>
private void CreateHorizontalTitles(
IDataSetModel model,
IDictionary<string, TableRow> horizontalRows,
ICollection<TableRow> horizontalOrderedRows)
{
foreach (string dim in model.HorizontalKeys)
{
var row = new TableRow();
row.AddClass(HtmlClasses.HorizontalKeys);
// First cell is the title, which spawns over all columns used for vertical keys...
TableCell tableCell = this.CreateTitle(model.AllValidKeys[dim], dim, "hkeytitle");
tableCell.SetColSpan(Math.Max(1, model.VerticalKeys.Count));
row.AddCell(tableCell);
horizontalRows.Add(dim, row);
horizontalOrderedRows.Add(row);
}
}
示例8: LoadTableData
public override bool LoadTableData(TableDescription TableDataContent)
{
TableDataContent.NameID = "Abgegeben je Stiege" + NameID;
TableDataContent.HeadLine = String.Format("Abgegebene Stimmen aus der Stiege {0} ", NameID);
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Block" });
foreach (String WahlKurzName in Years)
{
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = WahlKurzName });
}
foreach (AbgegebenStiegenSummen RowEntry in ItemsSource)
{
TableRow NewRow = new TableRow();
NewRow.FirstCellIsRowHeader = true;
NewRow.AddCell(new TableCell() { Text = RowEntry.Block + " " + RowEntry.StiegenNummer});
foreach (AbgegebenStiegenSummen SummenPerWahl in RowEntry.AbgegebenJeVergleichsWahl)
{
NewRow.AddCell(new TableCell() { Text = Convert.ToString (SummenPerWahl.Abgegeben)});
}
TableDataContent.Rows.AddRow(NewRow);
}
return true;
}
示例9: AddVerticalKeyValues2
/// <summary>
/// Add vertical key values to the specified output Row
/// </summary>
/// <param name="verticalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddVerticalKeyValues2(
IDictionary<string, TableCell> verticalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model)
{
var tableCell = new TableCell { Text = currentValue };
tableCell.AddClass(HtmlClasses.VerticalKeyValue);
string text = this.GetLocalizedName(dimension, currentValue);
tableCell.SetupDisplayText(
currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
outputRow.AddCell(tableCell);
verticalPreviousValues[dimension] = tableCell;
}
示例10: AddHorrizontalKeyValues
/// <summary>
/// Add horrizontal key values to the specified output Row
/// </summary>
/// <param name="horizontalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddHorrizontalKeyValues(
IDictionary<string, TableCell> horizontalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model)
{
TableCell oldValue;
if (horizontalPreviousValues.TryGetValue(dimension, out oldValue) && oldValue != null
&& string.Equals(currentValue, oldValue.SdmxValue))
{
oldValue.ColumnSpan++;
}
else
{
var tableCell = new TableCell();
string text = this.GetLocalizedName(dimension, currentValue);
tableCell.SetupDisplayText(
currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
tableCell.AddClass(HtmlClasses.HorizontalKeyValue);
outputRow.AddCell(tableCell);
horizontalPreviousValues[dimension] = tableCell;
}
}
示例11: LoadTableData
public override bool LoadTableData(TableDescription TableDataContent)
{
TableDataContent.NameID = "Abgegeben je Kommission" + NameID;
TableDataContent.HeadLine = String.Format("Abgegebene Stimmen bei der Kommission {0} ", NameID);
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = "Komm." });
foreach (String WahlKurzName in Years)
{
TableDataContent.ColumnHeader.AddCell(new TableCell() { Text = WahlKurzName });
}
foreach (AbgegebenKommissionsSummen RowEntry in ItemsSource)
{
MBRWahl.TableRow NewRow = new TableRow();
NewRow.FirstCellIsRowHeader = true;
NewRow.AddCell (new TableCell (){Text = RowEntry.AktuelleKommissionsID});
foreach (AbgegebenKommissionsSummen SummenPerWahl in RowEntry.AbgegebenJeVergleichsWahl)
{
MBRWahl.TableDescription PopupTable = null;
if (SummenPerWahl.AbgegebenJeStiege.Count > 0) // Add third dimension popup informations
{
PopupTable = new TableDescription ();
PopupTable.HeadLine = "Woher stammen die Stimmen";
PopupTable.NameID = "VotesComeFrom";
foreach (AbgegebenKommissionsSummen ComesFrom in SummenPerWahl.AbgegebenJeStiege)
{
MBRWahl.TableRow NewPopupRow = new TableRow ();
NewPopupRow.AddCell (new TableCell () {Text = Convert.ToString (ComesFrom.Abgegeben)});
NewPopupRow.AddCell(new TableCell() { Text = ComesFrom.BlockName + " " + ComesFrom.StiegenNummer });
PopupTable.Rows.AddRow(NewPopupRow);
}
}
NewRow.AddCell(new TableCell() { Text = Convert.ToString(SummenPerWahl.Abgegeben),
ThirdLevelAdditionalInfos = PopupTable});
}
TableDataContent.Rows.AddRow(NewRow);
}
return true;
}