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.

Changing text value in sfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

131761 Jul 26,2017 04:42 AM Jul 28,2017 01:14 AM Xamarin.Forms 3
loading
Tags: SfDataGrid
Alex
Asked On July 26, 2017 04:42 AM

Here is my code:

     <sfgrid:GridTemplateColumn MappingName="Surname" HeaderText="Patient Record Status">        
                        <sfgrid:GridTemplateColumn.CellTemplate>        
                            <DataTemplate>          
                                <Label x:Name="label" Text="{Binding Surname}" TextColor="Black" />         
                            </DataTemplate>         
                        </sfgrid:GridTemplateColumn.CellTemplate>
                    </sfgrid:GridTemplateColumn>

And I am getting exception:
Unable to cast object of type 'Xamarin.Forms.Xaml.ListNode' to type 'Xamarin.Forms.Xaml.IElementNode'

I am also trying to change mapped value with converter:

    <ContentPage.Resources>
        <ResourceDictionary>
            <pages:BlaBlaConverter x:Key="SomeConverter"/>
        </ResourceDictionary>
    </ContentPage.Resources>

and

                   <sfgrid:GridTextColumn Width="200"
                                           HeaderText="Surname"
                                           MappingName="Surname" DisplayBinding="{Binding Surname, 
                                   Converter={StaticResource SomeConverter}}"/>

but getting:

Type StaticResource SomeConverter not found in xmlns http://xamarin.com/schemas/2014/forms MyApp


Ashok N [Syncfusion]
Replied On July 27, 2017 04:58 AM

Hi Alexej, 

Thanks for contacting Syncfusion support.  

We have checked the reported exception in GridTemplateColumn and GridTextColumn.DiplayBinding StaticResource SomeConverter not found issue with 15.2.0.46 but we are not able to reproduce the issue. Unbound column values was updated after edited values was committed in view. For your reference we have attached the working copy of the sample in the below location, please refer it. Could you please do revert us by modifying our sample to replicate the issue. Otherwise please share your sample along with replication procedure, that would be more helpful for us to proceed further.      
     
  
Regards, 
Ashok 


Alex
Replied On July 27, 2017 08:12 AM

Thank you for sample. It works.

Very strange, but when I have replaced my XAML:

<sfgrid:GridTemplateColumn MappingName="Surname" HeaderText="First Name binding">        
                        <sfgrid:GridTemplateColumn.CellTemplate>        
                            <DataTemplate>          
                                <Label x:Name="label" Text="{Binding Surname}" TextColor="Black" />         
                            </DataTemplate>         
                        </sfgrid:GridTemplateColumn.CellTemplate>
                    </sfgrid:GridTemplateColumn>

with equal XAML from sample my project also works:

               <sfgrid:GridTemplateColumn MappingName="FirstName" HeaderText="First Name binding">
                    <sfgrid:GridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Label x:Name="label" Text="{Binding FirstName}" TextColor="Black" />
                        </DataTemplate>
                    </sfgrid:GridTemplateColumn.CellTemplate>
                </sfgrid:GridTemplateColumn>


Ashok N [Syncfusion]
Replied On July 28, 2017 01:14 AM

Hi Alexej,  

Thanks for your update. Please let us know if you require further assistance on this. 

Regards, 
Ashok 


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.

;