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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Data binding

Thread ID:

Created:

Updated:

Platform:

Replies:

126380 Oct 12,2016 09:11 AM UTC Oct 13,2016 01:27 PM UTC UWP 1
loading
Tags: SfDataGrid
Benia, Rynharth
Asked On October 12, 2016 09:11 AM UTC

Hi,

I just want to bind the AllowEditing of the SfDataGrid to the Mapping value "CheckIn". The below AllowEditing binding is not working. Does anyone know how to do it.

 <my:SfDataPager x:Name="sfDataPager" PageSize="3" Source="{Binding List}"/>

<syncfusion:SfDataGrid x:Name="datagrid" ItemsSource="{Binding PagedSource,ElementName=sfDataPager}" >
            <syncfusion:SfDataGrid.Columns>
                <syncfusion:GridCheckBoxColumn AllowEditing="{Binding DataContext.CheckIn}"  MappingName="CheckIn" />             
            </syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>

Thanks,
Ryn

Jai Ganesh S [Syncfusion]
Replied On October 13, 2016 01:27 PM UTC

Hi Benia, 
 
We have analyzed your query. We regret to inform you that you can not bind GridCheckBoxColumn’s AllowEditing based on the underlying property but you can disable the cell based on the underlying property like below, 
 
<syncfusion:GridCheckBoxColumn MappingName="IsChecked" > 
                    <syncfusion:GridCheckBoxColumn.CellStyle> 
                        <Style TargetType="syncfusion:GridCell"> 
                            <Setter Property="utils:SetterValueBindingHelper.PropertyBinding"> 
                                <Setter.Value> 
                                     <utils:SetterValueBindingHelper Property="IsEnabled"  Binding="{Binding Converter={StaticResource converter}}"/> 
                                </Setter.Value> 
                            </Setter> 
                        </Style> 
                    </syncfusion:GridCheckBoxColumn.CellStyle> 
 </syncfusion:GridCheckBoxColumn> 
 
public class customconverter : IValueConverter 
    { 
        public object Convert(object value, Type targetType, object parameter, string language) 
        { 
           return (value as UserInfo).IsChecked; 
        } 
 
        public object ConvertBack(object value, Type targetType, object parameter, string language) 
        { 
            return (value as UserInfo).IsChecked; 
        } 
    } 
 
 
Screen Shot: 
 
 
 
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.

Warning Icon 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.Close Icon

;