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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing text value in sfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 08:58 AM UTC

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 12:12 PM UTC

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 05:14 AM UTC

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.

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

;