社区
C#
帖子详情
跳转按钮
lemowenzi
2003-10-17 08:22:52
在DataGrid里除了上下页外,我想加个跳转按钮怎么做
...全文
40
5
打赏
收藏
跳转按钮
在DataGrid里除了上下页外,我想加个跳转按钮怎么做
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
rengang11
2003-10-17
打赏
举报
回复
public int bindCostList(ref System.Web.UI.WebControls.DataGrid listGrid,String strWhere,int intPage)
{
int rowsCount = 0;
//从视图(othercost)取值
String strSel = "Select proj_id,cost_type_des,cost_id,cost_name,cost_des,provide_name,price,quantity,cost_flag_des,other_cost_id, (price * quantity) as totalprice From othercost ";
strSel = strSel + strWhere;
DataTable datatable = new DataTable();
datatable = dataManager.getDataTable(strSel);
listGrid.DataSource = datatable;
rowsCount = datatable.Rows.Count;
int intFact = rowsCount/listGrid.PageSize;
int intFactRe = rowsCount%listGrid.PageSize;
if(intFactRe != 0)
{
intFact ++ ;
}
if(intPage > intFact)
{
listGrid.CurrentPageIndex = intFact - 1;
listGrid.DataBind();
return rowsCount;
}
else
{
listGrid.DataBind();
return rowsCount;
}
}
rengang11
2003-10-17
打赏
举报
回复
把里面的类稍微该一下就行了
框架就这样了
lemowenzi
2003-10-17
打赏
举报
回复
ok!谢谢!!!
lemowenzi
2003-10-17
打赏
举报
回复
在线给分
高分求救!!!!!!!
rengang11
2003-10-17
打赏
举报
回复
#region 页数跳转按钮
/// <summary>
/// 页数跳转按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnGo_Click(object sender, System.EventArgs e)
{
//String strErrMsg = "对不起,您输入页码不正确";
String temp = "";
System.Text.StringBuilder messBuilder = new System.Text.StringBuilder();
if(txtBoxPage.Text == "")
{
//空值处理
this.Page.RegisterStartupScript("",@"<script>alert('"+promng.common.MessageLog.getMessage("M0002","跳转页面")+"')</script>");
return;
}
else
{
//正整数校验
messBuilder.Append(otherCostManage.checkProInt(txtBoxPage.Text,"页码"));
}
temp = messBuilder.ToString();
if(temp != "")
{
this.Page.RegisterStartupScript("",@"<script>alert('"+temp+"')</script>");
this.txtBoxPage.Text = "";
return;
}
//转换类型
int intPage = int.Parse(txtBoxPage.Text);
//输入值范围判断
if(intPage > gridCost.PageCount)
{
//String strMess = promng.common.MessageLog.getMessage("M0033");
this.Page.RegisterStartupScript("",@"<script>alert('"+promng.common.MessageLog.getMessage("M0033")+"')</script>");
this.txtBoxPage.Text = "";
return;
}
//取得项目编号,重新绑定数据列表
String strWhere =" where proj_id = '"+(String)ViewState["proj_id"]+"'";
int intSecondPage = intPage -1;
gridCost.CurrentPageIndex = intSecondPage;
//返回实际总行
int intResult = this.otherCostManage.bindCostList(ref gridCost,strWhere,intPage);
//总行除于页面尺寸
int intPageRe = intResult%gridCost.PageSize;
if( intPageRe != 0)
{
intPageRe = 1;
}
int intPageCount = (intResult/gridCost.PageSize) + intPageRe;
pagetext(intResult.ToString(),intPageCount - 1,intPageCount);
//清空输入框
txtBoxPage.Text = "";
}
#endregion
android webview中html页面点击
按钮
跳转
到activity
在android端,用webview加载html,里面包含一个
按钮
,点击html里的
按钮
跳转
到android的另一个activity中
h5
跳转
小程序微信浏览器不显示
跳转
按钮
h5
跳转
小程序微信浏览器不显示
跳转
按钮
暴力解构PowerBI大赛作品
未来持续更新1 制作中文日期粒度切片器2 制作预警卡片和提示信息3 设置...
跳转
页导航11
按钮
超链接到其他PBI报表12 探索矩阵更丰富的样式213 折线图上突出阴影区域14 折线图上高亮显示指定线段15 资产负债表层级结构...
iview page分页添加
跳转
按钮
-输入页码后点击
跳转
在iview里,分页组件的电梯功能输入页码后需要按回车才能
跳转
这让不知道需要按回车的人摸不着头脑呀,所以呢,动动手写个
跳转
按钮
~效果如图: //点击
跳转
到输入的页码 goElevatorPage(){ var evtObj; var this...
Wordpress商品详情页新增Buy on amazon/ebay
跳转
按钮
Wordpress商品详情页新增amazonurl
跳转
按钮
Wordpress商品详情页新增amazonurl
跳转
按钮
后台商品编辑页面新增字段后台商品的数据保存前端商品页面的实现插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表...
C#
110,499
社区成员
642,566
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章