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

Rebind() changes?

5 Answers 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 18 Mar 2011, 04:10 PM
Hi,
Has anything changed in the working of the rebind method in the 2001 Q1 release?  It does not seem to rebind as before, I've not changed anything.
Regards,
Mike

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Mar 2011, 04:38 PM
Hello,

 Can you provide more info about your scenario and what exactly is not working? 

Regards,
Vlad
the Telerik team
0
Mike
Top achievements
Rank 1
answered on 18 Mar 2011, 05:14 PM
Hi Vlad,

Yes, I have a grid that has an image field, the image is not stored in the database, so I fetch the images from the server and then want to rebind the grid when the images arrive, 

The images do arrive, and if I scroll the grid the images appear when the row comes back into focus.  I've changed nothing since the update.

here is my code:

private

 

 

void Athlete_Image_Here(InvokeOperation io)

 

 

{

 

 

 

    if (io.HasError)

 

 

    {

 

        io.MarkErrorAsHandled();

 

    }

 

 

 

    else

 

    {

                IEnumerable<ProfileImage> friendsG =

            (

 

IEnumerable<ProfileImage>)io.Value;

 

 

 

 

            foreach (ProfileImage prof in friendsG)

 

 

            {

 

 

 

                tblAthlete ath = GC_Service.tblAthletes.Where(a => a.id == prof.id).FirstOrDefault();

 

 

 

 

                if (ath != null)

 

 

                {

 

 

 

                    byte[] image = prof.img;

 

 

                    ath.ProfileImage_Blob = image;

 

                }

 

            }

 

 

 

            this.WallView.Rebind();

 

 

    }

 

}

<

 

 

ControlTemplate x:Key="MyCustomRowTemplate" TargetType="telerik:GridViewRow">

 

 

 

 

<Border x:Name="rowsContainer" Background="Transparent" Padding="5,5,5,0">

 

 

 

 

<Border x:Name="selectedRow"

 

 

 

BorderThickness="0,0,0,1" BorderBrush="#FF000000">

 

 

 

 

<Border.Background>

 

 

 

 

<SolidColorBrush Color="White" Opacity="1"></SolidColorBrush>

 

 

 

 

</Border.Background>

 

 

 

 

<Grid>

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="*"></ColumnDefinition>

 

 

 

 

<ColumnDefinition Width="auto"></ColumnDefinition>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Stretch" >

 

 

 

 

<Image Source="{Binding tblAthlete.ProfileImage_Blob, Converter={StaticResource MyBinaryConverter}}" Width="40" Height="40" Margin="5" VerticalAlignment="Top" Stretch="UniformToFill"></Image>

 

 

 

 

<HyperlinkButton Padding="0,5" Content="{Binding tblAthlete.Name}" x:Name="btnAthName" Click="btnAthName_Click" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5" Tag="{Binding tblAthlete}" Foreground="{StaticResource ButtonBrushKey}" />

 

 

 

 

<TextBlock Padding="0,5" VerticalAlignment="Top" Text="{Binding ., Converter={StaticResource MyMessageConverter}}" TextWrapping="Wrap" Margin="5" MaxWidth="500"></TextBlock>

 

 

 

 

<HyperlinkButton x:Name="WallPost" Click="WallPost_Click" Padding="0,5" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5" Tag="{Binding }" Foreground="{StaticResource ButtonBrushKey}" Content="{Binding ApplicationStrings.details, Source={StaticResource ResourceWrapper}}" Visibility="{Binding ., Converter={StaticResource MyWallDetailsFlagConverter}}" />

 

 

 

 

<TextBlock Padding="0,5" VerticalAlignment="Top" Text="{Binding dateAdded, Converter={StaticResource MyWallDateConverter}}" TextWrapping="Wrap" Margin="5" Foreground="DarkGray"></TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<Button Grid.Column="1" Content="x" Foreground="DarkGray" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="Hand" Margin="5"

 

 

 

 

Visibility="{Binding AthleteID, Converter={StaticResource isMyPost}}" ToolTipService.ToolTip="Delete Post" Style="{StaticResource ImageButtonStyle}" Tag="{Binding }" Click="BtnDeleteWall_Clicked"></Button>

 

 

 

 

</Grid>

 

 

 

 

</Border>

 

 

 

 

</Border>

 

 

 

 

</ControlTemplate>

 

 
0
Mike
Top achievements
Rank 1
answered on 21 Mar 2011, 06:58 PM
Hi Vlad,

Any update on this?  Has anything changed to break this?

Mike
0
Vlad
Telerik team
answered on 22 Mar 2011, 07:58 AM
Hello,

 Unfortunately we are not aware of any change that can break such scenario. Please send us small example demonstrating the different behavior compared to the previous via support ticket. 

Kind regards,
Vlad
the Telerik team
0
Mike
Top achievements
Rank 1
answered on 22 Mar 2011, 04:29 PM
Hi Vlad,

OK Thanks, I'll roll back some stuff if the Q1 release didn't break this

Thanks,

Mike
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Mike
Top achievements
Rank 1
Share this question
or