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

how to reposition html elements after an ajax postback/callback

1 Answer 51 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
gunther
Top achievements
Rank 1
gunther asked on 14 Oct 2009, 01:40 PM
i notice that when an ajax request is completed -- be it from the ajaxmanage itself or the get_eventArgument() method -- the ajaxified controls render at their original positions and their parent html elements outside do not rerender to compensate for the ajaxified controls' new positions and/or sizes.

for example, i have an ajaxified radgrid that is built dynamically in code.  it is nested within a standard, non-server html table.  since the width of the radgrid varies depending on the number of columns it has, it typically returns to the page wider than the table it is nested within, causing its right side to extend beyond the right side of the table.

i've thought about using the ajaxmanager's ClientEvents-OnResponseEnd event to invoke javascript that would somehow rerender certain elements on the page, but i wanted to hear from someone here before i spent too much time exploring that route.

thx in advance

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 19 Oct 2009, 01:11 PM
Hello gunther,

I tested this integration demo of RadGrid, RadComboBox and RadAjax wrapping the grid instance in table cell of html table and supplying variable number of columns for the grid when choosing a particular name and All options from the combobox. The table cell was stretched accordingly when the grid is refreshed in these cases.

Can you please verify that on your machine? Furthermore, in case you enabled scrolling and static headers for the grid and the issue is observed under IE browser only, check whether setting table-layout: fixed for the surrounding html table as explained here eliminates the discrepancy.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
gunther
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or