会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Keep Walking
no matter what has happened...what's happening...what will happen...we must be on the way...
博客园
首页
新随笔
联系
管理
订阅
RowDataBound DataKeys
//
给组织结构赋值
protected
void
GridView1_RowDataBound(
object
sender, GridViewRowEventArgs e)
{
if
(e.Row.RowType
==
DataControlRowType.DataRow)
{
int
userRegisterID
=
Convert.ToInt32(GridView1.DataKeys[e.Row.RowIndex].Value);
CheckBoxList CheckBoxList1
=
(CheckBoxList)e.Row.Cells[
6
].FindControl(
"
CheckBoxList1
"
);
DataTable dt
=
UserOrganization.sGetUserOrganizationByUserRegisterID(userRegisterID);
if
(dt.Rows.Count
!=
0
)
{
foreach
(DataRow dtRow
in
dt.Rows)
{
foreach
(ListItem item
in
CheckBoxList1.Items)
{
if
(Convert.ToInt32(item.Value)
==
Convert.ToInt32(dtRow[
"
OrganizationID
"
]))
{
item.Selected
=
true
;
}
}
}
}
}
}
posted @
2008-01-13 20:47
Fernando
阅读(
812
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告