欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net 數(shù)據(jù)綁定時(shí)對(duì)數(shù)據(jù)列做個(gè)性化處理

 更新時(shí)間:2011年12月22日 20:21:30   作者:  
asp.net 數(shù)據(jù)綁定時(shí)對(duì)數(shù)據(jù)列做個(gè)性化處理,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

protected void dgQuery_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
{
DataRow drRow = ((DataRowView)e.Item.DataItem).Row;
string commonPartId = drRow["cniBackup1"].ToString();
HyperLink hlTrans = (HyperLink)e.Item.FindControl("hlTrans");
if (hlTrans != null)
{
hlTrans.Text = "--";
hlTrans.NavigateUrl = "javascript:void();";
}

//刪除列
LinkButton btnDelete = (LinkButton)e.Item.FindControl("btnDelete");
//沒有刪除權(quán)限且找到控件
if (!bCanDelete && btnDelete != null)
{
//查找控件所在Cell列號(hào)
for (int i = 0; i < e.Item.Cells.Count; i++)
{
if (e.Item.Cells[i].HasControls() && e.Item.Cells[i].Controls.IndexOf(btnDelete) > 0)
{
int index = e.Item.Cells[i].Controls.IndexOf(btnDelete);
e.Item.Cells[i].Controls.RemoveAt(index);
Literal tips = new Literal();
tips.Text = "--";
e.Item.Cells[i].Controls.AddAt(index, tips);

//e.Item.Cells[i].Text = "--";
break;
}
}
}
}
}

相關(guān)文章

最新評(píng)論