Hi,
I have the following code in the RadGrid of my UserControl:
| <telerik:GridTemplateColumn UniqueName="MyColumnName" HeaderText="MyColumnName" Visible='<%# (Mode == SearchAndSelectMode.DataMode) ? true : false %>'> |
| <ItemTemplate> |
| <asp:ImageButton ID="MyButton" runat="server" ImageUrl="../App_Themes/eventIS/Grid/MyButton.gif" CommandName="DoSomething" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
The "Mode" property is a public property of my UserControl, and I want to display this column depending on the value of that property. But when I run it, the following error appears:
Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.GridTemplateColumn does not have a DataBinding event.
I know it is also possible to hide the columns in code behind, but I want to do it in the ascx because then it is more clear what happens in my opinion. Is there any way to achieve what I want with the RadGrid?