I asked on Telerik's site, but there is apparently not enough traffic there to generate answers.
I am trying to convert an asp ImageButton to a RadImageButton because there are some useful features that would make my life a bit easier. However, the binding for the image URL won't work - at least the way I am doing it.
So this works (both are in the same ListView):
<asp:ImageButton ID="im" runat="server" ImageUrl='<%# Eval("ImgUrl") %>' />
But this:
<telerik:RadImageButton runat="server" ID="itemImageButton" '>
<Image Url='<%# Eval("ImgUrl") %>' />
</telerik:RadImageButton>
gives me an error something like Telerik.Web.UI.ButtonBase.ButtonImage does not have a DataBinding event.
If someone could point me in the right direction to get this done with the RadImageButton control (if possible), I would appreciate it.
I was recently facing exactly the same issue. Apparently child objects/properties in some controls are not DataBound-able.
You have to do the binding for the image URL inside the
telerik:RadImageButton
tag itself, so instead of using<Image Url="" />
section, place it in theImage-Url
attribute:You can ommit
.ToString()
part though.One more "issue" that I've got when switching from
asp:ImageButton
totelerik:RadImageButton
was the necessity to set thewidth
andheight
explicitly. Without it, it didn't work ouf of the box. Image (icon) was malformed, even though it was like 24x24 sized. I ended up settingwidth=""
andheight=""
attributes, but addingCssClass
and using styles should work too.