This is a migrated thread and some comments may be shown as answers.

Switch Image on RadioButton Select

1 Answer 79 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 16 Feb 2018, 06:44 AM
I'm using the rie_onImageLoading Method to load a serverside Image into the control at Page_Load. Now, when selecting another RadioButton of the list, I would like to load another image (preferably with Ajax/RadAjaxManager without postback) into the control. How can I achieve it? All other controls have sth. like "DataSource", but I'm afraid the RIE doesn't have it...

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 19 Feb 2018, 03:38 PM
Hi Jan,

I have just ansered your support ticket on the matter and will advise that will cotinue our conversation there. For convenience I am pasting my answer here:

It is enough to change the ImageUrl of the ImageEditor in order to change the edited image. For example:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadioButtonList1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadImageEditor1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadRadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
    <Items>
        <telerik:ButtonListItem Text="Image1" Selected="true" />
        <telerik:ButtonListItem Text="Image2" />
    </Items>
</telerik:RadRadioButtonList>
<telerik:RadImageEditor ID="RadImageEditor1" runat="server" RenderMode="Lightweight" ImageUrl="~/Images/image1.jpg" Width="790" Height="430px">
</telerik:RadImageEditor>
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (RadioButtonList1.SelectedIndex == 0)
    {
        RadImageEditor1.ImageUrl = "~/Images/image1.jpg";
    }
    else
    {
        RadImageEditor1.ImageUrl = "~/Images/image2.jpg";
    }
}


Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ImageEditor
Asked by
Jan
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or