------------------------------------- ASPX page Key code:
...... Other data bindings Add the following code on the appropriate location of the page. See execution effect
------------------------------------- CS page Key code: 1: First in the data binding event was added in the following code: private void wzbm_ItemDataBound (object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) {Label LBL = (label) E.Item.FindControl ("OID_SEL"); lbl.text = "
";}} 2: Button1 event triggered as follows: private void button1_click (Object sender, system.eventargs e) {oid_sel_str.text = request.form [" OID_GROUP "]; Foreach (DataGridItem a in wzbm.Items) {ix (a .ItemType == ListiteMTYPE.alternatingItem || a.itemtype == ListiteMTYPE.ITEM) {Label R = (label) A.FindControl ("OID_SEL"); if (R.Text.indexof (OID_SEL_STR.TEXT)> 0) { R.Text = "
"} else {r.text ="
"}}}} Reference link: http://www.dotNetBips.com/displayArticle.aspx?id=147 http://dev.9cbs.net/develop/article/20789.shtm http: // dev .9cbs.net / develop / article / 24 / 24295.shtm http://dev.9cbs.net/Develop/article/28/28250.shtm http://dev.9cbs.net/develop/Article/31/31059 SHTM