本文整理汇总了C#中GridItem类的典型用法代码示例。如果您正苦于以下问题:C# GridItem类的具体用法?C# GridItem怎么用?C# GridItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridItem类属于命名空间,在下文中一共展示了GridItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldDecorate
public override bool ShouldDecorate(GridItem gridItem)
{
return gridItem.Type != GridItemType.EmptyRow &&
gridItem.Type != GridItemType.GroupRow &&
gridItem.Type != GridItemType.DetailRow &&
(gridItem.State & GridItemStates.Master) == GridItemStates.Master;
}
示例2: AsEditRow
private void AsEditRow(GridItem item, bool current)
{
if (current && creatorData.Mode == GridItemMode.Edit)
{
item.Type = GridItemType.EditRow;
}
}
示例3: ShouldDecorate
public override bool ShouldDecorate(GridItem gridItem)
{
return (gridItem.State & GridItemStates.Selected) == GridItemStates.Selected
&& gridItem.Type != GridItemType.DetailRow
&& gridItem.Type != GridItemType.EmptyRow &&
gridItem.Type != GridItemType.GroupRow;
}
示例4: CreateItem
public GridItem CreateItem(object dataItem)
{
var item = new GridItem
{
DataItem = dataItem,
State = GridItemStates.Default,
Type = GridItemType.DataRow
};
if (dataItem is IGroup)
{
AsGroupRow(item);
}
else
{
var current = comparer.KeysEqualTo(dataItem);
AsEditRow(item, current);
AsSelected(item, current);
AsMaster(item);
}
return item;
}
示例5: GridMenu
public GridMenu(int xloc, int yloc, int cols, Texture2D texture, SoundBank soundbank)
{
m_xpos = xloc;
m_ypos = yloc;
m_columns = cols;
m_texture = texture;
m_soundbank = soundbank;
Console.WriteLine("Starting Drawing at [" + xloc + ", " + yloc + "]");
m_x = -1;
m_y = 0;
m_rows = 1;
m_num_items = 0;
m_selected_x = -1;
m_selected_y = -1;
m_list = new List<SelectionItem>();
m_grid = new GridItem[m_rows, m_columns];
for (int i = 0; i < m_columns; i++)
{
m_grid[m_rows-1, i] = new GridItem();
m_grid[m_rows-1, i].m_selectable = false;
}
}
示例6: FormatGridItem
protected void FormatGridItem(GridItem item)
{
item.Style["color"] = "#000";
if (item is GridDataItem)
{
item.Style["vertical-align"] = "middle";
item.Style["text-align"] = "center";
}
switch (item.ItemType) //Mimic RadGrid appearance for the exported PDF file
{
/* case GridItemType.Item: item.Style["background-color"] = "#4F4F4F"; break;
case GridItemType.AlternatingItem: item.Style["background-color"] = "#494949"; break;
case GridItemType.Header: item.Style["background-color"] = "#2B2B2B"; break;
case GridItemType.CommandItem: item.Style["background-color"] = "#000000"; break;
*/
}
if (item is GridCommandItem)
{
item.PrepareItemStyle(); //needed to span the image over the CommandItem cells
}
}
示例7: InitializeCell
public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem)
{
base.InitializeCell(cell, columnIndex, inItem);
if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText))
{
cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile);
}
}
示例8: SetGridEntity
public void SetGridEntity(GridItem gridItem)
{
GridItem = gridItem;
if (gridItem != null)
{
gridItem.Owner = this;
}
}
示例9: Should_insert_as_first_cell_if_not_groups
public void Should_insert_as_first_cell_if_not_groups()
{
var gridItem = new GridItem { Type = GridItemType.DataRow };
var builder = new Mock<IGridRowBuilder>();
builder.Setup(b => b.CreateRow()).Returns(new HtmlElement("tr"));
decorator.Decorate(builder.Object, gridItem, true);
var node = decorator.CreateRow();
node.Children.Count.ShouldEqual(1);
}
示例10: GetChildItems
public override IEnumerable<GridItem> GetChildItems(GridItem item)
{
using (CmsContext.Editing)
{
var id = new Id(item.Id);
var entity = CmsService.Instance.GetItem<Entity>(id);
return entity.GetChildren<Entity>().Select(GetGridItem);
}
}
示例11: CreateBuilder
public IGridRowBuilder CreateBuilder(GridRenderingData renderingData, GridItem item)
{
var creator = BuilderRegistry[item.Type];
ExecuteRowCallback(item, renderingData.Callback);
var gridRowBuilder = creator(renderingData, item);
return decoratorProvider.ApplyDecorators(gridRowBuilder, item, renderingData.HasDetailTemplate);
}
示例12: CreateFooterBuilder
public virtual IGridRowBuilder CreateFooterBuilder(GridRenderingData renderingData)
{
var builder = new GridRowBuilder(renderingData.Columns.Select(column => cellBuilderFactory.CreateFooterCellBuilder(column, renderingData.AggregateResults )));
var item = new GridItem
{
GroupLevel = renderingData.GroupMembers.Count(),
Type = GridItemType.FooterRow
};
return decoratorProvider.ApplyDecorators(builder, item, renderingData.HasDetailTemplate);
}
示例13: InitializeCell
public override void InitializeCell(System.Web.UI.WebControls.TableCell cell, int columnIndex, GridItem inItem)
{
if (Initializable(inItem.ItemType))
{
base.InitializeCell(cell, columnIndex, inItem);
return;
}
object dataItem = inItem.DataItem;
string value = null;
if (null != dataItem)
{
DataRowView row = dataItem as DataRowView;
if (null != row)
{
value = row[base.DataField].ToString();
}
else
{
PropertyInfo pi = dataItem.GetType().GetProperty(base.DataField);
if (null != pi)
{
object selectedValue = pi.GetValue(dataItem);
if (null != selectedValue)
{
TypeCode targetDataType = this.TargetDataType;
if (targetDataType != TypeCode.Empty)
{
selectedValue = Convert.ChangeType(selectedValue, targetDataType);
}
value = selectedValue.ToString();
}
}
}
}
TextBox ctrl = new TextBox();
ctrl.TextMode = this.TextMode;
ctrl.ID = "txt" + base.UniqueName;
ctrl.ReadOnly = base.ReadOnly;
if (this.ControlWidth != Unit.Empty)
ctrl.Width = this.ControlWidth;
if (this.ControlHeight != Unit.Empty)
ctrl.Height = this.ControlHeight;
if (null != value)
{
ctrl.Text = String.Format("{0}", value);
}
cell.Controls.Add(ctrl);
}
示例14: Should_insert_cell_after_group_cell_if_grouped
public void Should_insert_cell_after_group_cell_if_grouped()
{
var gridItem = new GridItem { Type = GridItemType.DataRow, GroupLevel = 1 };
var builder = new Mock<IGridRowBuilder>();
var container = new HtmlElement("tr");
new HtmlElement("td").AppendTo(container);
builder.Setup(b => b.CreateRow()).Returns(container);
decorator.Decorate(builder.Object, gridItem, true);
var node = decorator.CreateRow();
node.Children.Count.ShouldEqual(2);
node.Children[1].Attribute("class").ShouldEqual(UIPrimitives.Grid.HierarchyCell);
}
示例15: CreateGroupFooterItem
public GridItem CreateGroupFooterItem(object dataItem)
{
if (creatorData.ShowGroupFooter)
{
var groupFooter = new GridItem
{
GroupLevel = creatorData.GroupsCount,
DataItem = dataItem,
Type = GridItemType.GroupFooterRow
};
return groupFooter;
}
return null;
}