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

Problem with Ajax, Paging and Control in Template

3 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Veteran
Thomas asked on 05 Aug 2010, 09:31 AM
Hi, I use a Radgrid with a templated column:

<telerik:GridTemplateColumn>
    <ItemTemplate>
        <obout:ImageZoom ID="ImageZoom_Suche" runat="server" StyleFolder="styles/simple" ImageUrl='<%# Eval("Partnumber", "~/Images/{0}.jpg") %>' BigImageUrl='<%# Eval("Partnumber", "~/Images/{0}.jpg") %>' Position="IMAGE_CENTER" ShowLoading="false" />
    </ItemTemplate>
    <ItemStyle Width="50px" Height="50px" HorizontalAlign="Center" />
</telerik:GridTemplateColumn>

Inside the templated column I use an ImageZoom control. This works fine, but when Ajax is enabled, and you click on a page in the pager, the control doesn't work anymore on the paged page, only the first page is working "normal". Do I need to register the Imagezoom control with AjaxManager?

Any ideas please?

Thank you for your help

Thomas

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Aug 2010, 04:08 PM
Hello Thomas,

You can try using regular UpdatePanel with UpdateMode="Conditional" that wraps RadGrid instead RadAjaxManager and see whether it makes any difference.

All the best,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Thomas
Top achievements
Rank 1
answered on 10 Aug 2010, 08:40 AM
Hello Nikolay,

thanks, that did the trick.

Can you maybe tell me why AjaxManager doesn't work in this case?

Thanks again for your help

Best regards

Thomas
0
Nikolay Rusev
Telerik team
answered on 13 Aug 2010, 08:46 AM
Hello Thomas,

The behavior is caused because RadAjax need all script in custom controls to be registered via Page in order to evaluate them properly. While ImageZoom control register those script via Control itself.
If you reflect ImageZoom control assembly and inspect ScriptManager.RegisterStartupScript you will notice that scripts are registered as follow:
..
 if (this.isAjax)
    {
        this.smType.GetMethod("RegisterStartupScript", new Type[] { typeof(Control), typeof(Type), typeof(string), typeof(string), typeof(bool) }).Invoke(this.AjaxSM, new object[] { control, control.GetType(), key, script, includeScriptTags });
    }
...

The highlighted code should be Page if you need RadAjax to function properly.

Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Veteran
Answers by
Nikolay Rusev
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or