本文整理汇总了C#中System.Web.UI.WebControls.DataGridPageChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridPageChangedEventArgs类的具体用法?C# DataGridPageChangedEventArgs怎么用?C# DataGridPageChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridPageChangedEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridPageChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dgResult_PageIndexChanged
protected void dgResult_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
string strSql = TextSql.Text.Trim();
dgResult.DataSource = DataHelper.ExecuteDataset(CommandType.Text, strSql, null);
dgResult.CurrentPageIndex = e.NewPageIndex;
dgResult.DataBind();
}
示例2: PageChanged
/// <summary>
/// Rebind control
/// </summary>
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
//reset index
searchList.CurrentPageIndex = e.NewPageIndex;
//get category id
string keywordKey = Request.QueryString["keywords"];
//ProductList list = ProductList.NewList();
var list = new List<Product>();
foreach (Product product in ProductList.GetAll())
{
bool isResult = product.Name.ToLowerInvariant().Contains(keywordKey.ToLowerInvariant()) ||
product.Description.ToLowerInvariant().Contains(keywordKey.ToLowerInvariant());
if (isResult)
{
list.Add(product);
}
}
//bind data
searchList.DataSource = list;
searchList.DataBind();
}
示例3: dgMain_PageIndexChanged
protected void dgMain_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
dgMain.CurrentPageIndex = e.NewPageIndex;
dgMain.DataSource = CreateDataSource();
dgMain.DataBind();
}
示例4: GridItemList_PageIndexChanged
protected void GridItemList_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
GridItemList.CurrentPageIndex = e.NewPageIndex;
_count = (Utils.CIntDef(GridItemList.CurrentPageIndex, 0) * GridItemList.PageSize);
GridItemList.DataSource = Session["AdItemList"] as DataTable;
GridItemList.DataBind();
}
示例5: PageChanged
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
products.CurrentPageIndex = e.NewPageIndex;
// Get the category from the query string
// string categoryKey = Request["categoryId"];
string categoryKey = WebComponents.CleanString.InputText(Request["categoryId"], 50);
// Check to see if the contents are in the Data Cache
if(Cache[categoryKey] != null){
// If the data is already cached, then used the cached copy
products.DataSource = (IList)Cache[categoryKey];
}else{
// If the data is not cached, then create a new products object and request the data
Product product = new Product();
IList productsByCategory = product.GetProductsByCategory(categoryKey);
// Store the results of the call in the Cache and set the time out to 12 hours
Cache.Add(categoryKey, productsByCategory, null, DateTime.Now.AddHours(12), Cache.NoSlidingExpiration , CacheItemPriority.High, null);
products.DataSource = productsByCategory;
}
// Bind the data to the control
products.DataBind();
// Set the label to be the query parameter
lblPage.Text = categoryKey;
}
示例6: CartPageChanged
protected void CartPageChanged(object sender, DataGridPageChangedEventArgs e)
{
// (re)bind the data when the page changes
cart.CurrentPageIndex = e.NewPageIndex;
cart.DataSource = myCart.GetCartItems();
cart.DataBind();
}
示例7: PageChanged
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
products.CurrentPageIndex = e.NewPageIndex;
// Get the search terms from the query string
string searchKey = WebComponents.CleanString.InputText(Request["keywords"], 100);
if (searchKey != ""){
// Create a data cache key
string cacheKey = "search" + searchKey;
// Check if the objects are in the cache
if(Cache[cacheKey] != null){
products.DataSource = (IList)Cache[cacheKey];
}else{
// If that data is not in the cache then use the business logic tier to fetch the data
Product product = new Product();
IList productsBySearch = product.GetProductsBySearch(searchKey);
// Store the results in a cache
Cache.Add(cacheKey, productsBySearch, null, DateTime.Now.AddHours(12), Cache.NoSlidingExpiration , CacheItemPriority.High, null);
products.DataSource = productsBySearch;
}
// Databind the data to the controls
products.DataBind();
}
}
示例8: PageChanged
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
items.CurrentPageIndex = e.NewPageIndex;
// Get the productId from the query string
string productId = WebComponents.CleanString.InputText(Request["productId"], 50);
// Array for the data
IList itemsByProduct = null;
// Check if the data exists in the data cache
if(Cache[productId] != null){
itemsByProduct = (IList)Cache[productId];
}else{
// If the data is not in the cache then fetch the data from the business logic tier
Item item = new Item();
itemsByProduct = item.GetItemsByProduct(productId);
// store the output in the data cache with a 12 hour expiry
Cache.Add(productId, itemsByProduct, null, DateTime.Now.AddHours(12), Cache.NoSlidingExpiration , CacheItemPriority.High, null);
}
// Set the control datasource
items.DataSource = itemsByProduct;
// If there is data fetch the product name
if(itemsByProduct.Count > 0)
productName.Text = ((ItemInfo)itemsByProduct[0]).ProductName;
// Bind the data to the the control
items.DataBind();
}
示例9: DataGrid1_PageIndexChanged
protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
DataGrid1.SelectedIndex = -1;
DataGrid1.DataSource = (DataTable)Session["T_data"];
DataGrid1.DataBind();
}
示例10: MyDataGrid_Page
protected void MyDataGrid_Page(object sender, DataGridPageChangedEventArgs e)
{
//int startIndex;
//startIndex = detail.CurrentPageIndex * detail.PageSize;
//detail.CurrentPageIndex = e.NewPageIndex;
//setBind();
}
示例11: openCasesGrid_PageIndexChanged
private void openCasesGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
// Set the selected page of the grid
this.openCasesGrid.CurrentPageIndex = e.NewPageIndex;
// ReBind the grid to update the display
this.DataBind();
}
示例12: dotForumDisplay_PageIndexChanged
protected void dotForumDisplay_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
//Atualizar o index da paginação
dotForumDisplay.CurrentPageIndex = e.NewPageIndex;
//Carregar a GridView
LoadThreads();
}
示例13: PageChanged
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
itemsGrid.CurrentPageIndex = e.NewPageIndex;
string id = Request.QueryString["productId"];
itemsGrid.DataSource = new ProductManager().GetItemListByProductID(id);
itemsGrid.DataBind();
}
示例14: DataGrid_PageChanged
public void DataGrid_PageChanged(object sender,DataGridPageChangedEventArgs e)
{
this.dgList .CurrentPageIndex = e.NewPageIndex;
UDS.Components.Task task = new UDS.Components.Task();
DataTable mydb = Tools.ConvertDataReaderToDataTable(task.GetTodayTaskBySomeone(DateTime.Today.ToShortDateString(),Username,1));
this.dgList .DataSource = mydb.DefaultView;
this.dgList.DataBind();
setgrid();
}
示例15: PageChanged
protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
{
productsList.CurrentPageIndex = e.NewPageIndex;
string id = Request.QueryString["categoryId"];
productsList.DataSource = new ProductManager().GetProductListByCategoryID(id);
productsList.DataBind();
}