本文整理汇总了C#中GridPanel.SetExtensibleProperty方法的典型用法代码示例。如果您正苦于以下问题:C# GridPanel.SetExtensibleProperty方法的具体用法?C# GridPanel.SetExtensibleProperty怎么用?C# GridPanel.SetExtensibleProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridPanel
的用法示例。
在下文中一共展示了GridPanel.SetExtensibleProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLoad
protected override void OnLoad(EventArgs args)
{
if (!Sitecore.Context.ClientPage.IsEvent)
{
SetProperties();
GridPanel gridPanel = new GridPanel();
Controls.Add(gridPanel);
gridPanel.Columns = 4;
GetControlAttributes();
foreach (string text2 in base.Attributes.Keys)
{
gridPanel.Attributes.Add(text2, base.Attributes[text2]);
}
gridPanel.Style["margin"] = "0px 0px 4px 0px";
SetViewStateString("ID", ID);
Sitecore.Web.UI.HtmlControls.Literal literal = new Sitecore.Web.UI.HtmlControls.Literal("All");
literal.Class = ("scContentControlMultilistCaption");
gridPanel.Controls.Add(literal);
gridPanel.SetExtensibleProperty(literal, "Width", "50%");
gridPanel.SetExtensibleProperty(literal, "Row.Height", "20px");
LiteralControl spacer = new LiteralControl(Images.GetSpacer(24, 1));
gridPanel.Controls.Add(spacer);
gridPanel.SetExtensibleProperty(spacer, "Width", "24px");
literal = new Sitecore.Web.UI.HtmlControls.Literal("Selected");
literal.Class = "scContentControlMultilistCaption";
gridPanel.Controls.Add(literal);
gridPanel.SetExtensibleProperty(literal, "Width", "50%");
spacer = new LiteralControl(Images.GetSpacer(24, 1));
gridPanel.Controls.Add(spacer);
gridPanel.SetExtensibleProperty(spacer, "Width", "24px");
Scrollbox scrollbox = new Scrollbox();
scrollbox.ID = GetUniqueID("S");
gridPanel.Controls.Add(scrollbox);
scrollbox.Style["border"] = "3px window-inset";
gridPanel.SetExtensibleProperty(scrollbox, "rowspan", "2");
DataTreeview dataTreeView = new DataTreeview();
dataTreeView.ID = ID + "_all";
scrollbox.Controls.Add(dataTreeView);
dataTreeView.DblClick = ID + ".Add";
ImageBuilder builderRight = new ImageBuilder();
builderRight.Src = "Applications/16x16/nav_right_blue.png";
builderRight.ID = ID + "_right";
builderRight.Width = 0x10;
builderRight.Height = 0x10;
builderRight.Margin = "2";
builderRight.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Add");
ImageBuilder builderLeft = new ImageBuilder();
builderLeft.Src = "Applications/16x16/nav_left_blue.png";
builderLeft.ID = ID + "_left";
builderLeft.Width = 0x10;
builderLeft.Height = 0x10;
builderLeft.Margin = "2";
builderLeft.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Remove");
LiteralControl literalControl = new LiteralControl(builderRight.ToString() + "<br/>" + builderLeft.ToString());
gridPanel.Controls.Add(literalControl);
gridPanel.SetExtensibleProperty(literalControl, "Width", "30");
gridPanel.SetExtensibleProperty(literalControl, "Align", "center");
gridPanel.SetExtensibleProperty(literalControl, "VAlign", "top");
gridPanel.SetExtensibleProperty(literalControl, "rowspan", "2");
Sitecore.Web.UI.HtmlControls.Listbox listbox = new Listbox();
listBox = listbox;
gridPanel.SetExtensibleProperty(listbox, "VAlign", "top");
gridPanel.SetExtensibleProperty(listbox, "Height", "100%");
gridPanel.Controls.Add(listbox);
listbox.ID = ID + "_selected";
listbox.DblClick = ID + ".Remove";
listbox.Style["width"] = "100%";
listbox.Size = "10";
listbox.Attributes["onchange"] = "javascript:document.getElementById('" + this.ID + "_help').innerHTML=this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:''";
listbox.Attributes["class"] = "scContentControlMultilistBox";
dataTreeView.Disabled = ReadOnly;
listbox.Disabled = ReadOnly;
ImageBuilder builderUp = new ImageBuilder();
builderUp.Src = "Applications/16x16/nav_up_blue.png";
builderUp.ID = ID + "_up";
builderUp.Width = 0x10;
builderUp.Height = 0x10;
builderUp.Margin = "2px";
builderUp.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Up");
ImageBuilder builderDown = new ImageBuilder();
builderDown.Src = "Applications/16x16/nav_down_blue.png";
builderDown.ID = ID + "_down";
//.........这里部分代码省略.........
示例2: OnLoad
// This method is the only method that differs from Sitecore's
// TreeList class
protected override void OnLoad(EventArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (!Sitecore.Context.ClientPage.IsEvent)
{
Database contentDatabase = Sitecore.Context.ContentDatabase;
if (!string.IsNullOrEmpty(this.DatabaseName))
{
contentDatabase = Factory.GetDatabase(this.DatabaseName);
}
this.SetProperties();
GridPanel child = new GridPanel();
this.Controls.Add(child);
child.Columns = 4;
this.GetControlAttributes();
foreach (string str in base.Attributes.Keys)
{
child.Attributes.Add(str, base.Attributes[str]);
}
child.Style["margin"] = "0px 0px 4px 0px";
base.SetViewStateString("ID", this.ID);
Literal literal = new Literal("All");
literal.Class = "scContentControlMultilistCaption";
child.Controls.Add(literal);
child.SetExtensibleProperty(literal, "Width", "50%");
child.SetExtensibleProperty(literal, "Row.Height", "20px");
LiteralControl control = new LiteralControl(Images.GetSpacer(0x18, 1));
child.Controls.Add(control);
child.SetExtensibleProperty(control, "Width", "24px");
literal = new Literal("Selected");
literal.Class = "scContentControlMultilistCaption";
child.Controls.Add(literal);
child.SetExtensibleProperty(literal, "Width", "50%");
control = new LiteralControl(Images.GetSpacer(0x18, 1));
child.Controls.Add(control);
child.SetExtensibleProperty(control, "Width", "24px");
Scrollbox scrollbox = new Scrollbox();
scrollbox.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("S");
child.Controls.Add(scrollbox);
if (!UIUtil.IsIE())
{
scrollbox.Padding = "0px";
}
scrollbox.Style["border"] = "3px window-inset";
child.SetExtensibleProperty(scrollbox, "rowspan", "2");
child.SetExtensibleProperty(scrollbox, "VAlign", "top");
// Instantiate the MultiTreeview rather than TreeviewEx
MultiRootTreeview ex = new MultiRootTreeview();
// Set the ParentItem of the treeview to the current item
// This allows the treeview to have a 'context' of where
// we currently are in the content tree
Item parentItem = contentDatabase.GetItem(ItemID);
ex.ParentItem = parentItem;
ex.ID = this.ID + "_all";
if (!string.IsNullOrEmpty(AncestorTemplateDatasource))
{
Item parent = parentItem;
while (parent != null && String.Compare(parent.TemplateID.ToString(), AncestorTemplateDatasource, StringComparison.OrdinalIgnoreCase) != 0)
{
parent = parent.Parent;
}
ex.MultiTrees.Add(2, parent);
}
else if (DataSources.Count > 0)
{
foreach (KeyValuePair<int, string> kvp in DataSources)
{
if (!string.IsNullOrEmpty(kvp.Value))
{
if (kvp.Value == ".")
{
ex.MultiTrees.Add(kvp.Key, parentItem);
}
else if (kvp.Value.StartsWith("."))
{
string path = kvp.Value.Replace(".", parentItem.Paths.FullPath);
ex.MultiTrees.Add(kvp.Key, contentDatabase.GetItem(path));
}
else
{
ex.MultiTrees.Add(kvp.Key, contentDatabase.GetItem(kvp.Value));
}
}
}
}
scrollbox.Controls.Add(ex);
ex.DblClick = this.ID + ".Add";
ex.AllowDragging = false;
ImageBuilder builder = new ImageBuilder();
builder.Src = "Applications/16x16/nav_right_blue.png";
builder.ID = this.ID + "_right";
builder.Width = 0x10;
builder.Height = 0x10;
builder.Margin = UIUtil.IsIE() ? "2px" : "2px 0px 2px 2px";
builder.OnClick = Sitecore.Context.ClientPage.GetClientEvent(this.ID + ".Add");
ImageBuilder builder2 = new ImageBuilder();
builder2.Src = "Applications/16x16/nav_left_blue.png";
//.........这里部分代码省略.........