本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.DataGridPoker.CreateControls方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridPoker.CreateControls方法的具体用法?C# DataGridPoker.CreateControls怎么用?C# DataGridPoker.CreateControls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.DataGridPoker
的用法示例。
在下文中一共展示了DataGridPoker.CreateControls方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreationEvents
public void CreationEvents ()
{
DataGridPoker p = new DataGridPoker ();
DataTable table = new DataTable ();
table.Columns.Add (new DataColumn ("one", typeof (string)));
table.Columns.Add (new DataColumn ("two", typeof (string)));
table.Columns.Add (new DataColumn ("three", typeof (string)));
p.DataSource = new DataView (table);
p.ItemCreated += new DataGridItemEventHandler (ItemCreatedHandler);
p.ItemDataBound += new DataGridItemEventHandler (ItemDataBoundHandler);
// No items added yet
ResetEvents ();
p.CreateControls (true);
Assert.IsTrue (item_created, "A1");
Assert.IsTrue (item_data_bound, "A2");
table.Rows.Add (new object [] { "1", "2", "3" });
ResetEvents ();
p.CreateControls (true);
Assert.IsTrue (item_created, "A3");
Assert.IsTrue (item_data_bound, "A4");
// no databinding
ResetEvents ();
p.CreateControls (false);
Assert.IsTrue (item_created, "A5");
Assert.IsFalse (item_data_bound, "A6");
}
示例2: OneTemplateColumn2
public void OneTemplateColumn2 ()
{
DataGridPoker p = new DataGridPoker ();
p.ShowFooter = true;
p.AutoGenerateColumns = false;
p.DataSource = new ArrayList ();
TemplateColumn tc = new TemplateColumn ();
tc.HeaderText = " ";
tc.FooterTemplate = new MyTemplate ("hola");
p.Columns.Add (tc);
Assert.AreEqual (1, p.Columns.Count, "columns-1");
Assert.AreEqual (0, p.Controls.Count, "controls-1");
p.CreateControls (true);
// This time we have the table there. Thanks to the empty ArrayList
Assert.AreEqual (1, p.Columns.Count, "columns-2");
Assert.AreEqual (1, p.Controls.Count, "controls-2");
p.PrepareCH ();
Assert.AreEqual (1, p.Columns.Count, "columns-3");
Assert.AreEqual (1, p.Controls.Count, "controls-3");
}
示例3: CreateControls
public void CreateControls ()
{
DataGridPoker p = new DataGridPoker ();
DataTable table = new DataTable ();
table.Columns.Add (new DataColumn ("one", typeof (string)));
table.Columns.Add (new DataColumn ("two", typeof (string)));
table.Columns.Add (new DataColumn ("three", typeof (string)));
table.Rows.Add (new object [] { "1", "2", "3" });
p.DataSource = new DataView (table);
p.CreateControls (true);
Assert.AreEqual (p.Controls.Count, 1, "A1");
ShowControlsRecursive (p.Controls [0], 1);
}
示例4: 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");
}