We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to bind a column asyncronously

Thread ID:

Created:

Updated:

Platform:

Replies:

123898 Apr 29,2016 04:29 PM May 2,2016 08:15 AM WPF 1
loading
Tags: SfDataGrid
Silvio
Asked On April 29, 2016 04:29 PM

HI,

I have a SFDatagrid that has a column like this:

           <Syncfusion:GridImageColumn  HeaderText="Image" MappingName="IconImage"   ShowHeaderToolTip="False" AllowGrouping="False" AllowSorting="False" AllowFiltering="False" AllowEditing="False" Stretch="Uniform" >
            </Syncfusion:GridImageColumn>

The mapped binded property "IconImage" is a ViewModel property that is quite slow, since it has to fetch a binary data from database and dynamically create a Bitmap image, before returning it.
So, I'm wondering if there is a way to mark this property as async. Otherwise the datagrid becomes very slow, waiting for the bitmap creation for every row that's displayed.

It should be very nice to have something similar to the "IsAsync=True" that can be used with the "{Binding}" construct, but it seems it can't be used here.

Can you help me to correctly call this property asyncronously so that the datagrid is not freezed when scrolled ?

Silvio


Jai Ganesh S [Syncfusion]
Replied On May 2, 2016 08:15 AM

Hi Silvio, 
 
You can achieve your requirement for binding the column asynchronously by setting the “IsAsync” property like below, 
 
<syncfusion:GridImageColumn HeaderText="Country" 
                            MappingName="ImageLink" 
                            Padding="2,2,2,2" 
                            TextAlignment="Center" 
                            ValueBinding="{Binding Path=ImageLink, 
                                                                                     Converter={StaticResource stringToImageConverter},IsAsync=True}" /> 
 
 
 
                           (Or) 
 
<syncfusion:GridTemplateColumn HeaderText="ImageLink" MappingName="ImageLink"> 
                            <syncfusion:GridTemplateColumn.CellTemplate> 
 
                                <DataTemplate> 
                                    <Image  Source="{Binding ImageLink,Converter={StaticResource stringToImageConverter},IsAsync=True}"/> 
                                </DataTemplate> 
 
                            </syncfusion:GridTemplateColumn.CellTemplate> 
 </syncfusion:GridTemplateColumn> 
 
 
 
Regards, 
Jai Ganesh S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;