gpt4 book ai didi

c# - 当 gridview 在页面加载时加载时默认加载第二页

转载 作者:太空宇宙 更新时间:2023-11-03 14:48:13 25 4
gpt4 key购买 nike

我想在页面加载时默认加载gridview的第二页。这可能吗?

//Loads when they page loads
protected void BindDataExpense()
{
dsExpenseTable = objexp.GetCommissionBreakDownTable(name, breakdownType);
gridlist.DataSource = dsExpenseTable.Tables[0];
gridlist.DataBind();
}

//changes the page number
protected void PageIndexChangingExpense(object sender, GridViewPageEventArgs e)
{

dsExpenseTable = objexp.GetCommissionBreakDownTable(name, breakdownType);
gridlist.PageIndex = e.NewPageIndex;
gridlist.DataSource = dsExpenseTable.Tables[0];
gridlist.DataBind();
}

最佳答案

我解决了!我已将此代码添加到我的 gridview 中的 pageindex 和 pagesize

 <asp:GridView ID="gridlist" runat="server" AutoGenerateColumns="false" GridLines="None"  AllowSorting="True" AllowPaging="True" PageSize="35" PageIndex = "1">

关于c# - 当 gridview 在页面加载时加载时默认加载第二页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53214538/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com