Dear Team,
I have a rad Grid, with in which I have created a checkbox column and assing the Data to this grid. The check box is getting check or unchecked according to the Data. Perferct till here.
<telerik:GridTemplateColumn HeaderText="IsIndividual" UniqueName="IsIndividual" ReadOnly="true">
<ItemTemplate>
<asp:CheckBox ID="chkboxIsIndividual" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
But this check box appears editable, I can uncheck/ check it in the Grid. But I want this column to be read Only. The grid should show checked/unchecked as per the data but should not allow to edit this checkbox. When I try to make the enable property to false, all the records a show checked, which is incorrect :(
Below is the code in the
radCBTransactionDetails_ItemCreated to check/uncheck the checkbox.
if (column.UniqueName == "IsIndividual" && column is GridTemplateColumn)
{
CheckBox chk = (CheckBox)e.Item.FindControl("chkboxIsIndividual");
// chk.Enabled = false;
if (gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["IsIndividual"].ToString().ToUpper().Equals("TRUE"))
{
chk.Checked = true;
//chk.Enabled = false;
editLink.Text = "ViewIndividual";
}
else if (gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["IsIndividual"].ToString().ToUpper().Equals("FALSE"))
{
chk.Checked = false;
//chk.Enabled = true;
editLink.Text = "Bulk";
}
}
Please help me with this asap.
I have a rad Grid, with in which I have created a checkbox column and assing the Data to this grid. The check box is getting check or unchecked according to the Data. Perferct till here.
<telerik:GridTemplateColumn HeaderText="IsIndividual" UniqueName="IsIndividual" ReadOnly="true">
<ItemTemplate>
<asp:CheckBox ID="chkboxIsIndividual" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
But this check box appears editable, I can uncheck/ check it in the Grid. But I want this column to be read Only. The grid should show checked/unchecked as per the data but should not allow to edit this checkbox. When I try to make the enable property to false, all the records a show checked, which is incorrect :(
Below is the code in the
radCBTransactionDetails_ItemCreated to check/uncheck the checkbox.
if (column.UniqueName == "IsIndividual" && column is GridTemplateColumn)
{
CheckBox chk = (CheckBox)e.Item.FindControl("chkboxIsIndividual");
// chk.Enabled = false;
if (gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["IsIndividual"].ToString().ToUpper().Equals("TRUE"))
{
chk.Checked = true;
//chk.Enabled = false;
editLink.Text = "ViewIndividual";
}
else if (gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["IsIndividual"].ToString().ToUpper().Equals("FALSE"))
{
chk.Checked = false;
//chk.Enabled = true;
editLink.Text = "Bulk";
}
}
Please help me with this asap.