怎么让datagrid分页,美观些。

来源:百度知道 编辑:UC知道 时间:2024/05/30 09:39:53
datagrid默认的分页实在是太难看了。只是数字,或者上下页。要是上下页换成图片也行。或者变得跟系统默认的不同也行。不知道谁用过什么特别的方法.....
这是其中分页的一段代码
<PagerStyle VerticalAlign="Middle" NextPageText="下一页" Font-Size="Large" Font-Underline="True"
Font-Names="Raavi" Font-Bold="True" PrevPageText="上一页" HorizontalAlign="Center" ForeColor="White"
BackColor="#003399" Mode="NumericPages"></PagerStyle>

希望高手能够有详细的代码讲解
晕~~
楼下有的没看懂我的意思吗?分页谁都会,只是想把分页做的花俏点,需要怎么做,想要点思路

这个datagrd不能办到
换成dataview就行了~~
如果你想换成dataview我有特效。就找我

给你段完整的代码,你看一下思路,注意我里头很多逻辑处理在别的类,你只能看看思路了,基本能解决你的问题了

//绑定数据信息
private void BindDocInfo()
{
DataTable dt = ucMyDoc.GetDocuments();

if (dt == null)
{
this.lErrorMessage.Visible = true;
this.lErrorMessage.Text = ucMyDoc.Message;
return;
}

//处理分页条件下的删除
int iCount = dt.Rows.Count;

int iCurrentPage = dgDocument.CurrentPageIndex;
int iCNum = dgDocument.PageCount;
int iCPageNum = dgDocument.PageSize;

//判断是否为最后页的记录
if ((iCurrentPage+1) == iCNum && iCount%iCPageNum == 0)
{
if (iCurrentPage > 0)
{
dgDocument.CurrentPageIndex = iCurrentPage - 1;
}
else
{
d