GridView showing twice on AJAX UpdatePanel

GridView showing twice on AJAX UpdatePanel

am 08.11.2007 15:24:42 von ghealy

Strange problem...

Have a gridview on a page (within an update panel) for displaying
event dates.

GridView loads fine first time around with the PageLoad.

There are 2 text fields a user can use to enter a new new. Upon
clicking the "Add Button" these are added to the database, the
gridview refreshes its datasource and the GridView is reloaded through
the UpdatePanel to show the extra row.

HOWEVER, when the update panel refreshes it now shows TWO grids, on
top is the new one with the extra row, and beneath is the original
with the rows from the initial page loads. Any subsequent dates that
are added are put into the first grid fine but the second beneath
always remains on the page with the original rows from the first page
load.

Any ideas why this might be??

Re: GridView showing twice on AJAX UpdatePanel

am 08.11.2007 20:39:59 von NoSpamMgbworld

It has to do with how you are binding the grid. Most likely you are using
Page_Load to initially fill the grid and then rebinding with the asynch AJAX
call. If so, you are creating a grid and then creating a second one. If both
are done via the "same channel" (same way of filling the grid) you should be
fine. Without seeing code, I can only guess.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"GearĂ³id" wrote in message
news:1194531882.425223.96590@t8g2000prg.googlegroups.com...
> Strange problem...
>
> Have a gridview on a page (within an update panel) for displaying
> event dates.
>
> GridView loads fine first time around with the PageLoad.
>
> There are 2 text fields a user can use to enter a new new. Upon
> clicking the "Add Button" these are added to the database, the
> gridview refreshes its datasource and the GridView is reloaded through
> the UpdatePanel to show the extra row.
>
> HOWEVER, when the update panel refreshes it now shows TWO grids, on
> top is the new one with the extra row, and beneath is the original
> with the rows from the initial page loads. Any subsequent dates that
> are added are put into the first grid fine but the second beneath
> always remains on the page with the original rows from the first page
> load.
>
> Any ideas why this might be??
>