I have a radgrid with a readonly column named Status. After my validation completes I need to change the value of the column if there is an error. I'm having problems changing the value. Any suggestions would be helpful.
Thanks
if
(errorCount > 0)
{
TableCell statusCell = item[
"STATUS"
];
(statusCell.Controls[0]
as
TextBox).Text =
"Error"
;
(statusCell.Controls[0]
as
TextBox).BackColor = System.Drawing.Color.Red;
}
<telerik:RadGrid ID=
"rdDeposits"
AllowSorting=
"False"
AllowPaging=
"False"
runat=
"server"
AutoGenerateColumns=
"False"
AllowAutomaticInserts=
"False"
OnPreRender=
"rdDeposits_PreRender"
AllowAutomaticDeletes=
"False"
Skin=
"Web20"
OnNeedDataSource=
"rdDeposits_NeedDataSource"
OnItemDataBound=
"rdDeposits_ItemDataBound"
GridLines=
"Horizontal"
OnItemCommand=
"rdDeposits_ItemCommand"
OnItemCreated=
"rdDeposits_ItemCreated"
OnDeleteCommand=
"rdDeposits_ItemDeleted"
AllowMultiRowEdit=
"False"
Width=
"738px"
Height=
"360px"
>
<MasterTableView ShowFooter=
"true"
DataKeyNames=
"ESCROW_ACCOUNT_DEPOSIT_ID"
CommandItemDisplay=
"Top"
EditMode=
"InPlace"
TableLayout=
"Fixed"
>
<CommandItemTemplate>
<div style=
"padding: 5px 5px;"
>
<asp:Button ID=
"btnAdd"
CommandName=
"InitInsert"
Text=
"Add Transaction"
runat=
"server"
/>
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField=
"ESCROW_ACCOUNT_DEPOSIT_ID"
UniqueName=
"ESCROW_ACCOUNT_DEPOSIT_ID"
ReadOnly=
"true"
Visible=
"false"
>
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField=
"DEPOSIT_TRANS_TYPE_ID"
HeaderText=
"Type"
UniqueName=
"DEPOSIT_TRANS_TYPE_SDESC"
ListTextField=
"DEPOSIT_TRANS_TYPE_SDESC"
ListValueField =
"DEPOSIT_TRANS_TYPE_ID"
DropDownControlType=
"DropDownList"
ColumnEditorID=
"GridDropDownColumnEditor1"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"110px"
/>
<FooterStyle HorizontalAlign=
"Right"
Font-Bold=
"true"
/>
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField=
"EXPECTED_DATE"
HeaderText=
"Expected Date"
UniqueName=
"EXPECTED_DATE"
ReadOnly=
"true"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"90px"
/>
<ItemStyle HorizontalAlign=
"Center"
/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"EXPECTED_AMOUNT"
HeaderText=
"Expected Amount"
UniqueName=
"EXPECTED_AMOUNT"
ReadOnly=
"true"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"100px"
/>
<ItemStyle HorizontalAlign=
"Right"
/>
<FooterStyle HorizontalAlign=
"Right"
Font-Bold=
"true"
/>
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn DataField=
"ACTUAL_DATE"
HeaderText=
"Actual Date"
UniqueName=
"ACTUAL_DATE"
DataType=
"System.DateTime"
ColumnEditorID=
"GridDateTimeColumnEditor"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"100px"
/>
</telerik:GridDateTimeColumn>
<telerik:GridNumericColumn DataField=
"ACTUAL_AMOUNT"
HeaderText=
"Actual Amount"
UniqueName=
"ACTUAL_AMOUNT"
NumericType=
"Currency"
Resizable=
"False"
MaxLength=
"8"
DataType=
"System.Decimal"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"100px"
/>
<ItemStyle HorizontalAlign=
"Center"
/>
<FooterStyle HorizontalAlign=
"Right"
Font-Bold=
"true"
/>
</telerik:GridNumericColumn>
<telerik:GridBoundColumn DataField=
"STATUS"
HeaderText=
"Status"
UniqueName=
"STATUS"
ReadOnly=
"true"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"90px"
/>
<ItemStyle HorizontalAlign=
"Center"
/>
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ButtonType=
"ImageButton"
Text=
"Delete"
ImageUrl=
'../Images/deleteX.GIF'
CommandName=
"Delete"
UniqueName=
"Delete"
>
<HeaderStyle Font-Bold=
"True"
HorizontalAlign=
"Center"
Width=
"15px"
/>
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField=
"EXPECTED_TRANSACTION_IND"
UniqueName=
"EXPECTED_TRANSACTION_IND"
ReadOnly=
"true"
Visible=
"false"
ForceExtractValue=
"Always"
>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<SelectedItemStyle BackColor=
"#F8C320"
/>
<ClientSettings EnableRowHoverStyle=
"true"
>
<Selecting AllowRowSelect=
"true"
/>
<Scrolling AllowScroll=
"true"
UseStaticHeaders=
"true"
SaveScrollPosition=
"true"
/>
</ClientSettings>
</telerik:RadGrid>
Thanks