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

    Datagrid checkbox check/uncheck

    Hi ,

    I have two rows binded to datagrid in silverlight. First column is checkbox.
    If I am selecting one checkbox then other should get unchek. how to chieve this.

  • #753471

    If you want to Toogle checkbox selection of gridview control then use below sample code and refer that and implement in your application.

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

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



    <asp:TemplateField HeaderText="Check">
    <asp:CheckBox ID="chkSelect" runat="server" onclick="CheckGrid(this);" />

    Refer below link for more details.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #753481
    You can create a method where you can pass the current row to skip

    rivate void DisableCheckboxColumnInRow(DataGridRow row)
    var checkBoxColumn = Datagrid1.Columns[0];
    var checkBoxCell = GetCell(checkBoxColumn, row);
    checkBoxCell.IsEnabled = false;

    private static DataGridCell GetCell(DataGridColumn column, DataGridRow row)
    var cellContent = column.GetCellContent(row);
    return (DataGridCell)cellContent.Parent;

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #753498
    Here you go with the sample code and detailed explanation to accomplish this task.
    Let me know if this doesn't help or yyou require any other information related this query.

    Asheej T K

  • Sign In to post your comments