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.
Regards,
Ayesha
<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;
}
</script>
<asp:TemplateField HeaderText="Check">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" onclick="CheckGrid(this);" />
</ItemTemplate>
</asp:TemplateField>
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;
}