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

Imagebound problem

2 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zeshan
Top achievements
Rank 1
zeshan asked on 17 Sep 2008, 12:47 PM
Hi,

I have image template item in grid,
and i am showing images in it. this grid is in a popup.

 <telerik:GridTemplateColumn UniqueName="imgPicture">
                                         <ItemTemplate>
                                             <asp:Image ID="Picture" runat="server" Height="100px" ImageAlign="Middle" Width="150px" />
                                         </ItemTemplate>
                                         <HeaderStyle HorizontalAlign="Center" Width="15%" />
                                         <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50%" />
                                     </telerik:GridTemplateColumn>


i have an image button to swap this image with another image in grid.
and i am showing another popup on swap image button click. The user select the image and click on save button.

The problem is that when I click on the "save button" on the popup then my previous popup grid rebinds and both of the events fires "NeedDataSource" and
"ItemDataBound".
in itemdatabound i am giving the imageurl.

i have checked that image url is also correct and new image replaced on the old image but my grid shows old image.

what can be the problem.


Please guide me. its urgent

Thanks


2 Answers, 1 is accepted

Sort by
0
Prangadj
Top achievements
Rank 1
answered on 22 Sep 2008, 10:38 AM
What you said seems correct and the image should be replaced with new one if the image url is changed on ItemDataBound when rebinding grid. You can also make it work with ajax - check out this example about edit with popup.

Prangadj
0
zeshan
Top achievements
Rank 1
answered on 29 Sep 2008, 09:52 AM
Hello,

The problem was that when i was replacing the image then i was giving the same url in itemdatabound. When i change the URL then image has been replaced.

Means if the url will be same for old and new image then old image will be visible.

Thanks.
Tags
Grid
Asked by
zeshan
Top achievements
Rank 1
Answers by
Prangadj
Top achievements
Rank 1
zeshan
Top achievements
Rank 1
Share this question
or