I've looked at a number of posts here on doing this and just can't seem to get it to work. But I have inside of a GridTemplateColumn and based on the value of one of the data columns I want to set it to disabled. My data values are either "OPEN" or "CLOSED". The checkbox in question is cbMarkCompleted and the datavalue I'm checking is TaskStatusTypeCode So here is my current code:
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"NotificationId"
DataField
=
"NotificationId"
DataType
=
"System.Int32"
display
=
"false"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"MARKCOMPLETED"
ShowFilterIcon
=
"false"
HeaderText
=
"Mark Completed"
HeaderStyle-Width
=
"65"
>
<
FilterTemplate
>
<
asp:CheckBox
ID
=
"cbAll"
runat
=
"server"
onclick
=
"CheckAll(this)"
/>
</
FilterTemplate
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"cbMarkCompleted"
runat
=
"server"
></
asp:CheckBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"NOTIFICATIONTYPE"
HeaderText
=
"Type"
DataField
=
"NOTIFICATIONTYPE"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"NOTIFICATIONTYPE"
HeaderStyle-Width
=
"80"
/>
<
telerik:GridBoundColumn
UniqueName
=
"DISPLAYTEXT"
HeaderText
=
"Text"
DataField
=
"DISPLAYTEXT"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"DISPLAYTEXT"
HeaderStyle-Width
=
"340"
/>
<
telerik:GridDateTimeColumn
UniqueName
=
"CREATEDON"
HeaderText
=
"Created On"
DataField
=
"CREATEDON"
ShowFilterIcon
=
"false"
DataFormatString
=
"{0:dd MMM yyyy}"
DataType
=
"System.DateTime"
HtmlEncode
=
"false"
ItemStyle-CssClass
=
"center"
CurrentFilterFunction
=
"GreaterThanOrEqualTo"
AutoPostBackOnFilter
=
"true"
HeaderStyle-Width
=
"100"
/>
<
telerik:GridDateTimeColumn
UniqueName
=
"MODIFIEDON"
HeaderText
=
"Last Update"
DataField
=
"MODIFIEDON"
ShowFilterIcon
=
"false"
DataFormatString
=
"{0:dd MMM yyyy}"
DataType
=
"System.DateTime"
HtmlEncode
=
"false"
ItemStyle-CssClass
=
"center"
CurrentFilterFunction
=
"GreaterThanOrEqualTo"
AutoPostBackOnFilter
=
"true"
HeaderStyle-Width
=
"100"
/>
<
telerik:GridDateTimeColumn
UniqueName
=
"DUEDATE"
HeaderText
=
"Due Date"
DataField
=
"DUEDATE"
ShowFilterIcon
=
"false"
DataFormatString
=
"{0:dd MMM yyyy}"
DataType
=
"System.DateTime"
HtmlEncode
=
"false"
ItemStyle-CssClass
=
"center"
CurrentFilterFunction
=
"GreaterThanOrEqualTo"
AutoPostBackOnFilter
=
"true"
HeaderStyle-Width
=
"100"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"ENTITYTYPE"
ShowFilterIcon
=
"false"
DataField
=
"ENTITYTYPE"
SortExpression
=
"ENTITYTYPE"
HeaderText
=
"Notification For"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
HeaderStyle-Width
=
"75"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkNavigateToItem"
runat
=
"server"
CommandName
=
"NAVIGATE"
Text='<%# Eval("EntityType") %>'
CommandArgument='<%# Eval("ENTITYID") + "," + Eval("EntityTypeCode") %>' />
<
asp:Label
ID
=
"lblEntityType"
runat
=
"server"
Text='<%# Eval("EntityType") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"ENTITYTYPECODE"
Visible
=
"false"
HeaderText
=
""
DataField
=
"ENTITYTYPECODE"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"ENTITYTYPECODE"
/>
<
telerik:GridBoundColumn
UniqueName
=
"TaskStatusTypeCode"
Visible
=
"false"
HeaderText
=
""
DataField
=
"TaskStatusTypeCode"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"TaskStatusTypeCode"
HtmlEncode
=
"true"
/>
</
Columns
>