本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.PokerGridView.DoGetData方法的典型用法代码示例。如果您正苦于以下问题:C# PokerGridView.DoGetData方法的具体用法?C# PokerGridView.DoGetData怎么用?C# PokerGridView.DoGetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.PokerGridView
的用法示例。
在下文中一共展示了PokerGridView.DoGetData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridView_CreateDataSourceSelectArguments
public void GridView_CreateDataSourceSelectArguments ()
{
DataSourceView view;
Page p = new Page ();
PokerGridView g = new PokerGridView ();
g.Sorting += new GridViewSortEventHandler (g_Sorting);
p.Controls.Add (g);
ObjectDataSource data = new ObjectDataSource ();
data.TypeName = typeof (DataSourceObject).AssemblyQualifiedName;
data.SelectMethod = "GetList";
data.SortParameterName = "sortExpression";
DataSourceSelectArguments arg;
p.Controls.Add (data);
g.DataSource = data;
g.DataBind ();
arg = g.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "Default");
g.AllowPaging = true;
g.PageIndex = 2;
g.PageSize = 3;
arg = g.DoCreateDataSourceSelectArguments ();
view = g.DoGetData ();
Assert.IsFalse (view.CanPage);
Assert.IsTrue (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = true, CanPage = false, CanRetrieveTotalRowCount = true");
// make DataSourceView.CanPage = true
data.EnablePaging = true;
arg = g.DoCreateDataSourceSelectArguments ();
view = g.DoGetData ();
Assert.IsTrue (view.CanPage);
Assert.IsFalse (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (new DataSourceSelectArguments (6, -1)), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = false");
g.AllowPaging = false;
arg = g.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = false");
// make DataSourceView.CanRetrieveTotalRowCount = true
data.SelectCountMethod = "GetCount";
arg = g.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = true");
g.AllowPaging = true;
arg = g.DoCreateDataSourceSelectArguments ();
DataSourceSelectArguments arg1 = new DataSourceSelectArguments (6, 3);
arg1.RetrieveTotalRowCount = true;
view = g.DoGetData ();
Assert.IsTrue (view.CanPage);
Assert.IsTrue (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (arg1), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = true");
g.AllowPaging = false;
g.AllowSorting = true;
g.EditIndex = 2;
g.PageIndex = 1;
g.Sort ("sort", SortDirection.Descending);
Assert.AreEqual (2, g.EditIndex, "EditIndex after Sort, Bound by DataSource");
Assert.AreEqual (1, g.PageIndex, "PageIndex after Sort, Bound by DataSource");
arg = g.DoCreateDataSourceSelectArguments ();
view = g.DoGetData ();
Assert.IsTrue (view.CanSort);
Assert.AreEqual (String.Empty, g.SortExpression, "SortExpression, Bound by DataSource");
Assert.AreEqual (SortDirection.Ascending, g.SortDirection, "SortDirection, Bound by DataSource");
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowSorting = true, Bound by DataSource");
}
示例2: GridView_Sort_and_DataSourceSelectArguments
public void GridView_Sort_and_DataSourceSelectArguments ()
{
DataSourceView view;
DataSourceSelectArguments arg;
Page p = new Page ();
PokerGridView g = new PokerGridView ();
g.Columns.Add (new BoundField ());
g.AllowSorting = true;
p.Controls.Add (g);
ObjectDataSource data = new ObjectDataSource ();
data.TypeName = typeof (DataSourceObject).AssemblyQualifiedName;
data.SelectMethod = "GetList";
data.SortParameterName = "sortExpression";
data.ID = "Data";
p.Controls.Add (data);
g.DataSourceID = "Data";
g.EditIndex = 2;
g.PageIndex = 1;
g.DataBind ();
g.Sort ("sort", SortDirection.Descending);
Assert.AreEqual (-1, g.EditIndex, "EditIndex after Sort, Bound by DataSourceID");
Assert.AreEqual (0, g.PageIndex, "PageIndex after Sort, Bound by DataSourceID");
arg = g.DoCreateDataSourceSelectArguments();
view = g.DoGetData ();
Assert.IsTrue (view.CanSort);
Assert.AreEqual ("sort", g.SortExpression, "SortExpression, Bound by DataSourceID");
Assert.AreEqual (SortDirection.Descending, g.SortDirection, "SortDirection, Bound by DataSourceID");
Assert.AreEqual ("sort DESC", arg.SortExpression, "AllowSorting = true, Bound by DataSourceID");
g.AllowSorting = false;
arg = g.DoCreateDataSourceSelectArguments ();
Assert.AreEqual ("sort DESC", arg.SortExpression, "AllowSorting = false, Bound by DataSourceID");
}