您的位置:首页 > 其它

datagrid分页控件的使用&&radiobuttonlist的使用

2005-09-13 11:17 756 查看

datagrid分页控件的使用

1. 在datagrid所在页的html中最上方写

<%@ Register TagPreFix="WebUserControl" TagName="Pager" Src="inc/PageBar.ascx"%>

2. 在datagrid的html代码后面写入
<WEBUSERCONTROL:PAGER id="PageBar" onclick="CutPage" Runat="server"></WEBUSERCONTROL:PAGER>

3.

后台使用时:在给datagrid邦定数据时加入
this.PageBar.RowCount = ds.Tables[0].Rows.Count;

this.PageBar.PageSize = this.DataGrid1.PageSize;

this.PageBar.CurrPage = this.DataGrid1.CurrentPageIndex;

4. this.PageBar.PageBind();

再定义这几个函数:

protected void CutPage(object sender,System.EventArgs e)

{

this.DataGrid1.CurrentPageIndex = this.PageBar.CurrPage;

this.BindBd();

}

private void BtCx_Click(object sender, System.EventArgs e)

{

this.BindBd();

  }

这样就完成datagrid的使用了。

radiobuttonlist的使用

例如:

id:pxxs

items为基选项。

Repeatdirction为排列方向。

在代码中要加入

selected =true

在后台使用时直接用(pxxs.SelectedItem)其SelectedItem属性就能茯得其值。

[/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐