国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

[轉]Gridview中實現RadioButton單選效果

2019-11-17 01:50:59
字體:
來源:轉載
供稿:網友

[轉]Gridview中實現RadioButton單選效果

HTML

<asp:TemplateField ItemStyle-Width="22px">                           <ItemTemplate>                               <asp:RadioButton ID="radButtonControl" GroupName="group1" runat="server" />                           </ItemTemplate>                       </asp:TemplateField>

CS

PRotected void gvWorkPlanList_RowDataBound(object sender, GridViewRowEventArgs e)       {           if (e.Row.RowType == DataControlRowType.DataRow)           {               RadioButton rb = (RadioButton)e.Row.FindControl("radButtonControl");               if (rb != null)                   rb.Attributes.Add("onclick", "onRadiobuttonClick('" + this.gvWorkPlanList.ClientID + "','" + rb.ClientID + "')");             }       }

JS

/**//*傳入的GridviewClientID和所選的RadioButton ClientID**/  function onRadiobuttonClick(gvControlID,selectedControlId)  {       var inputs = document.getElementById(gvControlID).getElementsByTagName("input");       for(var i=0; i <inputs.length; i++)       {           if(inputs[i].type=="radio")           {               if(inputs[i].id==selectedControlId)                   inputs[i].checked = true;               else                   inputs[i].checked = false;                         }       }  }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宜阳县| 海兴县| 绵阳市| 彰武县| 济南市| 株洲市| 武安市| 沿河| 博爱县| 云浮市| 思茅市| 祁连县| 定州市| 井研县| 钟祥市| 沾化县| 余姚市| 深州市| 大竹县| 洛浦县| 彰化县| 烟台市| 定边县| 德庆县| 同仁县| 岳池县| 罗江县| 杭锦旗| 合山市| 泸溪县| 东阿县| 彩票| 陇南市| 美姑县| 山东省| 三门峡市| 凌海市| 夏邑县| 阳东县| 辰溪县| 阳东县|