我的第一列很窄,但分页这列撑得很宽
我就想有没有什么方法把分页跨列显示? 截图地址:http://test.hbbaidu.com/t/0.jpg我是VS2005+AccessCS代码:
public partial class _Default : System.Web.UI.Page
{
private DataSet myDS = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Data_Load();
}
private void Data_Load()
{
string Conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Server.MapPath("App_Data/db.mdb");
string Sql = "SELECT id,pic FROM pic ORDER BY id DESC";
OleDbConnection oleConn = new OleDbConnection(Conn);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sql, oleConn);
oleConn.Open();
//填充数据库
myDataAdapter.Fill(myDS, "pic");
//绑定记录集
myDataGrid.DataSource = myDS;
myDataGrid.DataBind();
}
protected void myDataGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
myDataGrid.CurrentPageIndex = e.NewPageIndex;
myDataGrid.DataBind();
}
}ASPX代码:
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="myDataGrid" runat="server" AllowPaging="True" OnPageIndexChanged="myDataGrid_PageIndexChanged" PageSize="5"><PagerStyle Mode="NumericPages" PageButtonCount="20" />
</asp:DataGrid>
</div>
</form>
我就想有没有什么方法把分页跨列显示? 截图地址:http://test.hbbaidu.com/t/0.jpg我是VS2005+AccessCS代码:
public partial class _Default : System.Web.UI.Page
{
private DataSet myDS = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Data_Load();
}
private void Data_Load()
{
string Conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Server.MapPath("App_Data/db.mdb");
string Sql = "SELECT id,pic FROM pic ORDER BY id DESC";
OleDbConnection oleConn = new OleDbConnection(Conn);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sql, oleConn);
oleConn.Open();
//填充数据库
myDataAdapter.Fill(myDS, "pic");
//绑定记录集
myDataGrid.DataSource = myDS;
myDataGrid.DataBind();
}
protected void myDataGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
myDataGrid.CurrentPageIndex = e.NewPageIndex;
myDataGrid.DataBind();
}
}ASPX代码:
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="myDataGrid" runat="server" AllowPaging="True" OnPageIndexChanged="myDataGrid_PageIndexChanged" PageSize="5"><PagerStyle Mode="NumericPages" PageButtonCount="20" />
</asp:DataGrid>
</div>
</form>
解决方案 »
- ASP.net中怎么控制输入法状态
- System.Web.HttpContext.Current.Response.Write 写到指定位置
- 将字符串转成数字并比较的问题
- 在dropDownList控件中做友情链接应该怎么样写呢? 收到立即给分....
- 有关DropdownList控件的问题
- Datagrid 删除数据,而该数据表是双主键,如何删除?请各位帮帮忙,谢谢!
- 很笨的问题:水晶报表是什么东西^_^
- Asp.net做的网页如何在手机浏览器正常显示?
- 分求http://buy.cwecn.com/源码!!!
- sql语句的错误,请大家帮忙看看.
- 关于studio.net中调试的配置问题
- 关于对象引用及实例化的问题
http://community.csdn.net/Expert/topic/4644/4644440.xml?temp=.7777216
http://community.csdn.net/Expert/topic/4644/4644440.xml?temp=.7777216
这个问题楼上的哪个帮我解决一下才是正是。呵呵。不过这个问题不是很复杂。只是想听听高手们还有什么别的见解否
性别:女 女 男 女 男 女 男 女
年龄:22 11 22 55 25 44 77 66