Hi
I have a GridNumericColumn in my RadGrid (with automatic updates). Depending on the data loaded the GridNumericColumn may or may not be editable.
How can I set the ReadOnly of the GridNumericColumn in ItemDataBind?
<
telerik:GridNumericColumn
HeaderText
=
"Quarter1"
HeaderStyle-Width
=
"5%"
ItemStyle-Width
=
"5%"
HeaderButtonType
=
"TextButton"
DataField
=
"quarter1"
UniqueName
=
"quarter1"
AllowFiltering
=
"false"
DecimalDigits
=
"0"
MinValue
=
"0"
MaxValue
=
"999999999"
></
telerik:GridNumericColumn
>
protected
void
grdForecasts_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
{
GridDataItem item = e.Item
as
GridDataItem;
if
(item !=
null
)
{
DataRowView dataItem = ((DataRowView)item.DataItem);
TableCell Quarter1 = item[
"quarter1"
];
switch
(DateTime.Now.Month)
{
case
4:
case
5:
case
6:
Quarter1.ReadOnly =
true
;
// This is not working
break
;
}
}
}
}
Kind regards
Suzy