本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.DataGridPoker.Render方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridPoker.Render方法的具体用法?C# DataGridPoker.Render怎么用?C# DataGridPoker.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.DataGridPoker
的用法示例。
在下文中一共展示了DataGridPoker.Render方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpecialLinkButton2
public void SpecialLinkButton2 ()
{
DataTable dt = new DataTable();
dt.Columns.Add (new DataColumn("string_col", typeof(string)));
DataRow dr = dt.NewRow ();
dt.Rows.Add (new object [] { "Item 1" });
DataView dv = new DataView (dt);
DataGridPoker dg = new DataGridPoker ();
dg.DataSource = dv;
dg.AutoGenerateColumns = false;
dg.HeaderStyle.ForeColor = Color.FromArgb (255,255,255,255);
dg.HeaderStyle.BackColor = Color.FromArgb (33,33,33,33);
ButtonColumn bc = new ButtonColumn ();
bc.HeaderText = "Some header";
bc.DataTextField = "string_col";
bc.CommandName = "lalala";
dg.Columns.Add (bc);
BoundColumn bound = new BoundColumn ();
bound.HeaderText = "The other column";
bound.DataField = "string_col";
dg.Columns.Add (bound);
dg.DataBind ();
LinkButton lb = (LinkButton) FindByType (dg.Controls [0], typeof (LinkButton));
Assert.IsNotNull (lb, "lb");
StringWriter sr = new StringWriter ();
HtmlTextWriter output = new HtmlTextWriter (sr);
Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore");
lb.RenderControl (output);
Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore2");
string str = dg.Render ();
Assert.IsTrue (-1 != str.IndexOf ("<a>Item 1</a>"), "item1");
Assert.IsTrue (-1 != str.IndexOf ("<td>Item 1</td>"), "item1-2");
}
示例2: SpecialLinkButton1
public void SpecialLinkButton1 ()
{
DataTable dt = new DataTable();
dt.Columns.Add (new DataColumn("something", typeof(Int32)));
DataRow dr = dt.NewRow ();
dt.Rows.Add (new object [] { 1 });
DataView dv = new DataView (dt);
DataGridPoker dg = new DataGridPoker ();
dg.AllowSorting = true;
dg.HeaderStyle.Font.Bold = true;
dg.HeaderStyle.ForeColor = Color.FromArgb (255,255,255,255);
dg.HeaderStyle.BackColor = Color.FromArgb (33,33,33,33);
dg.DataSource = dv;
dg.DataBind ();
LinkButton lb = (LinkButton) FindByType (dg.Controls [0], typeof (LinkButton));
Assert.IsNotNull (lb, "lb");
StringWriter sr = new StringWriter ();
HtmlTextWriter output = new HtmlTextWriter (sr);
// Nothing here...
Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore");
lb.RenderControl (output);
// Nothing here...
Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore2");
dg.Render ();
// Surprise! after rendering the datagrid, the linkbutton has the ForeColor from the datagrid
Assert.AreEqual (Color.FromArgb (255,255,255,255), lb.ControlStyle.ForeColor, "fore3");
// Extra. Items != empty
Assert.AreEqual (1, dg.Items.Count, "itemCount");
}
示例3: OneTemplateColumn3
public void OneTemplateColumn3 ()
{
DataGridPoker p = new DataGridPoker ();
p.ShowFooter = true;
p.AutoGenerateColumns = false;
p.DataSource = new ArrayList ();
TemplateColumn tc = new TemplateColumn ();
tc.FooterTemplate = new MyTemplate ("hola");
p.Columns.Add (tc);
p.DataBind ();
StringWriter sw = new StringWriter ();
HtmlTextWriter tw = new HtmlTextWriter (sw);
Assert.AreEqual (1, p.Columns.Count, "columns");
Assert.AreEqual (1, p.Controls.Count, "controls");
string render = p.Render ();
// no items, but we have a footer
Assert.IsTrue (-1 != render.IndexOf ("hola"), "template");
}
示例4: Render
public void Render ()
{
DataGridPoker p = new DataGridPoker ();
Assert.AreEqual (p.Render (), String.Empty, "A1");
}
示例5: OneTemplateColumn1
public void OneTemplateColumn1 ()
{
DataGridPoker p = new DataGridPoker ();
TemplateColumn tc = new TemplateColumn ();
tc.ItemTemplate = new MyTemplate ("hola");
p.Columns.Add (tc);
ControlCollection controls = p.Controls;
p.CreateControls (true);
Assert.AreEqual (1, p.Columns.Count, "columns");
Assert.AreEqual (0, controls.Count, "controls");
string render = p.Render ();
// no items, even with a templated column.
// The table is not added if DataSource == null
Assert.IsTrue (-1 == render.IndexOf ("hola"), "template");
}