You must Sign In to post a response.
  • Category: Windows 8

    Disable enable button inside gridview

    I want If i checked any one checkbox that particular row button will enabled other rows button will be disable. At a time i can check only one checkbox and that particular row button will be enabled. others will be disabled.I cannot checked multiple checkbox.

    Can anyone help
  • #765903
    you can use javascript/JQuery for that, see below snippet

    <script type="text/javascript" src="Script/jquery-1.5.1min.js"></script>

    <script type="text/javascript" language="javascript">

    function toggleSelectionGrid(source)
    var isChecked = source.checked;
    $("#GirdViewTable input[id*='chkLeave']").each(function(index) {
    $(this).attr('checked', false);
    source.checked = isChecked;


    //on clock of ItemTemplate checkbox call able jQuery method
    < asp:CheckBox ID="chkLeave" runat="server" onclick="toggleSelectionGrid(this);" />

    hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765913

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    if (e.Row.RowType == DataControlRowType.DataRow)
    //Find the TextBox control.
    CheckBox Chek = (e.Row.FindControl(Chk) as CheckBox);
    //Find the DropDownList control.
    DropDownList ddlCountries = (e.Row.FindControl("ddlCountries") as DropDownList);

    Name : Dotnet Developer-2015
    Email Id

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

Sign In to post your comments