开发者

How to change values of Fields in GridView/RadGrid EditTemplate when a chkBox is checked?

When a 'Update' is clicked the row shows the Edititem mode.

I have a check box that when it is 'clicked' I want the other fields to dissapear/become read-only.

How can this be done client or server side?

My best guess is for server side I have something like this below.. but then in the event how do I get access 开发者_如何转开发to those items in edit mode and change them ?

<EditItemTemplate>
    <asp:CheckBox ID="cbNR" runat="server" AutoPostBack="True" 
        OnCheckedChanged="cbNR_Clicked"
        Checked='<%# Boolean.Parse(Eval("NR").ToString()) %>' />
</EditItemTemplate>


This would be pretty simple using jQuery. Code to hide the other cells when checkbox is checked:

jQuery(function() {
    $("input[id*='cbNR']").click(function() {
      $(this).parents("td").siblings().toggle();
    });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜