Add RADIO to DataGrid to implement radio

xiaoxiao2021-03-06  44

[b] ------------------------------------- ASPX page Key code: [/ B]

[b] [/ b] ...... Bind

Add the following code at the appropriate location of the page. To see the execution effect

[B] ------------------------------------- CS page Key code: [/ B]

[b] 1: First add the following code in the data binding event: [/ b] private void wzbm_itemdatabase (ibject 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 = ";}} [b] 2: Button1 event triggered as follows: [/ b] private void button1_click (Object sender, system.eventargs e) {OID_SEL_STR .Text = Request.form ["OID_GROUP"]; Foreach (DataGridItem a in wzbm.Items) {if (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/20/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

转载请注明原文地址:https://www.9cbs.com/read-79375.html

New Post(0)