本文整理汇总了C#中ListItemType类的典型用法代码示例。如果您正苦于以下问题:C# ListItemType类的具体用法?C# ListItemType怎么用?C# ListItemType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListItemType类属于命名空间,在下文中一共展示了ListItemType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LanguagesTemplateDropDown
public LanguagesTemplateDropDown(ListItemType type, string colName, CultureTypes types)
{
this.templateType = type;
// this.columnName = colName;
this.cultureTypes = types;
}
示例2: InitializeCell
/// <summary>
/// Overridden to replace the button with a confirmed button
/// </summary>
public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
if ( itemType != ListItemType.Footer && itemType != ListItemType.Header ) {
WebControl theButton = null;
if ( this.ButtonType == ButtonColumnType.LinkButton ) {
ConfirmedLinkButton theLinkButton = new ConfirmedLinkButton();
theLinkButton.Text = this.Text;
theLinkButton.CommandName = this.CommandName;
theLinkButton.CausesValidation = false;
theLinkButton.Message = this.Message;
theLinkButton.ID = theLinkButton.ClientID;
theButton = theLinkButton;
} else {
ConfirmedButton theNormalButton = new ConfirmedButton();
theNormalButton.Text = this.Text;
theNormalButton.CommandName = this.CommandName;
theNormalButton.CausesValidation = false;
theNormalButton.Message = this.Message;
theNormalButton.ID = theNormalButton.ClientID;
theButton = theNormalButton;
}
if (this.DataTextField.Length != 0) {
theButton.DataBinding += new EventHandler( OnDataBindColumn );
}
cell.Controls.Clear();
cell.Controls.Add(theButton);
}
}
示例3: InitializeCell
public override void InitializeCell (TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell (cell, columnIndex, itemType);
ITemplate t = null;
switch (itemType) {
case ListItemType.Header:
t = HeaderTemplate;
break;
case ListItemType.Footer:
t = FooterTemplate;
break;
case ListItemType.Item:
case ListItemType.AlternatingItem:
case ListItemType.SelectedItem:
t = ItemTemplate;
if (t == null)
cell.Text = " ";
break;
case ListItemType.EditItem:
t = EditItemTemplate;
if (t == null)
t = ItemTemplate;
if (t == null)
cell.Text = " ";
break;
}
if (t != null)
t.InstantiateIn (cell);
}
示例4: InitializeCell
public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
Control bindCtrl = null;
Control toAdd = null;
switch(itemType)
{
case ListItemType.Item : goto case ListItemType.SelectedItem;
case ListItemType.AlternatingItem
: goto case ListItemType.SelectedItem;
case ListItemType.SelectedItem
: if(DataField.Length != 0)
bindCtrl = cell;
break;
case ListItemType.EditItem
: if(!ReadOnly)
{
TextBox box = new TextBox();
toAdd = box;
if(DataField.Length != 0)
bindCtrl = box;
} else
goto case ListItemType.SelectedItem;
break;
}
if(toAdd != null)
cell.Controls.Add(toAdd);
if(bindCtrl != null)
bindCtrl.DataBinding += new EventHandler(OnDataBindColumn);
//throw new NotImplementedException();
}
示例5: CreateTemplate
/// <Summary>Creates a TextColumnTemplate</Summary>
/// <Returns>A TextColumnTemplate</Returns>
private TextColumnTemplate CreateTemplate( ListItemType type )
{
bool isDesignMode = false;
if (HttpContext.Current == null)
{
isDesignMode = true;
}
TextColumnTemplate template = new TextColumnTemplate(type);
if (type != ListItemType.Header)
{
template.DataField = DataField;
}
template.Width = Width;
if (type == ListItemType.Header)
{
template.Text = this.HeaderText;
}
else
{
template.Text = Text;
}
template.DesignMode = isDesignMode;
return template;
}
示例6: InitializeCell
public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
if (Enum.IsDefined(typeof(ListItemType), itemType) &&
itemType != ListItemType.Footer &&
itemType != ListItemType.Header)
{
WebControl toDisplay = null;
if(ButtonType == ButtonColumnType.PushButton)
{
Button b = new Button();
b.Text = Text;
b.CommandName = CommandName;
b.CausesValidation = false;
toDisplay = b;
} else
{
LinkButton lb = new DataGridLinkButton();
lb.Text = Text;
lb.CommandName = CommandName;
lb.CausesValidation = false;
toDisplay = lb;
}
if(DataTextField.Length > 0)
{
toDisplay.DataBinding += new EventHandler(OnDataBindButtonColumn);
}
cell.Controls.Add(toDisplay);
}
}
示例7: GridViewTemplate
public GridViewTemplate(ListItemType itemType, string headerName, string typeName, EnumInfoType infoType)
{
this.itemType = itemType;
this.headerName = headerName;
this.typeName = typeName;
this.infoType = infoType;
}
示例8: CreateItemTemplate
//Parameterised Constructor
public CreateItemTemplate(ListItemType item,string lectureID,string date,string text)
{
myListItemType = item;
this.lectureID = lectureID;
this.date = date;
this.text = text;
}
示例9: InitializeCell
public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
if ((itemType != ListItemType.Header) && (itemType != ListItemType.Footer))
{
WebControl child = null;
if (this.ButtonType == ButtonColumnType.LinkButton)
{
LinkButton button = new DataGridLinkButton {
Text = this.Text,
CommandName = this.CommandName,
CausesValidation = this.CausesValidation,
ValidationGroup = this.ValidationGroup
};
child = button;
}
else
{
Button button2 = new Button {
Text = this.Text,
CommandName = this.CommandName,
CausesValidation = this.CausesValidation,
ValidationGroup = this.ValidationGroup
};
child = button2;
}
if (this.DataTextField.Length != 0)
{
child.DataBinding += new EventHandler(this.OnDataBindColumn);
}
cell.Controls.Add(child);
}
}
示例10: ScrollDataGrid
public ScrollDataGrid(Label lblcol, string colnameval, int colnoval, ListItemType itype)
{
lbl = lblcol;
colname = colnameval;
colno = colnoval;
itemtype = itype;
}
示例11: DownloadColumnTemplate
public DownloadColumnTemplate (string id, string caption, ListItemType itemType) {
mobjTemplateType = itemType;
mstrID = id;
mstrCaption = caption;
if (mstrCaption == string.Empty) {
mstrCaption = "Download";
}
}
示例12: GetItemStyle
protected override Style GetItemStyle (ListItemType itemType, int repeatIndex)
{
Style s = new Style ();
s.BackColor = Color.Red;
s.BorderStyle = BorderStyle.Solid;
WebTest.CurrentTest.UserData = "GetItemStyle";
return s;
}
示例13: RenderItem
protected override void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
{
ListItem listItem = this.Items[repeatIndex];
if (_UnderlyingCheckbox != null) {
_UnderlyingCheckbox.InputAttributes["value"] = listItem.Value;
}
base.RenderItem(itemType, repeatIndex, repeatInfo, writer);
}
示例14: CreateItem
protected override RepeaterItem CreateItem(int itemIndex, ListItemType itemType) {
if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem) { //Plus others??
RowIdRepeaterItem item = new RowIdRepeaterItem(itemIndex, itemType);
item.DataBinding += new EventHandler(item_DataBinding);
return item;
} else {
return base.CreateItem (itemIndex, itemType);
}
}
示例15: AddList
public void AddList(string[] listItems, ListItemType itemType)
{
var list = this.document.AddList(null, 0, itemType);
foreach (var item in listItems)
{
this.document.AddListItem(list, item);
}
this.document.InsertList(list);
}