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. Image for the cookie policy date
close icon

update binding source of a GridTextColumn as soon as a change is made

Hello,
I am using sfdatagrid in a Xamarin Forms application with MVVM. I am binding the columns through the MappingName property. I want to support the edit functionality within the Grid. It seems it only updates the binded property when the focus leaves the cell to another cell. Is it possible to update the underlying property as soon as  user changes the column cell value. I found another article here with the same issue here https://www.syncfusion.com/forums/129684/is-it-possible-to-update-binding-source-of-a-gridtextcolumn-as-soon-as-a-change-is-made for WPF. I can't find any such property in the Xamarin Forms version.

thanks,
Pawan


5 Replies

PS Pavithra  Sivakumar Syncfusion Team April 5, 2017 05:20 PM UTC

Hi Pawan, 
 
Thanks for Contacting Syncfusion support. 
 
We have understand your requirement. Your requirement of updating the underlying property when user changes the column cell value can be achieved by setting Mode=TwoWay in Value binding property . 
 
Refer the below code example for more details. 
 
<sfGrid:SfDataGrid x:Name="dataGrid" 
                       AllowGroupExpandCollapse="True" 
                       AutoGenerateColumns="False" 
                       ItemsSource="{Binding OrdersInfo}"> 
        <sfGrid:SfDataGrid.Columns> 
            <sfGrid:GridTextColumn MappingName="OrderID" ValueBinding="{Binding OrderID, Mode=TwoWay}"/> 
            <sfGrid:GridTextColumn MappingName="CustomerID" ValueBinding="{Binding CustomerID, Mode=TwoWay}"/> 
            <sfGrid:GridTextColumn MappingName="Freight" ValueBinding="{Binding Freight, Mode=TwoWay}"/> 
        </sfGrid:SfDataGrid.Columns> 
    </sfGrid:SfDataGrid> 
 
 
Regards, 
Pavithra S 



PJ Pawan Jindal April 5, 2017 06:03 PM UTC

Hi Pavithra,

Thanks so much for the quick reply. That resolved it.

Best,
Pawan


PS Pavithra  Sivakumar Syncfusion Team April 6, 2017 12:33 PM UTC

Hi Pawan, 
  
Thanks for the update. 
  
We are glad to hear that your issue has been resolved. Please let us know, if you may have any other queries. 
  
Regards, 
Pavithra S 
 



DB Douglas Bustos April 14, 2018 06:59 PM UTC

Dont work that with the lasting versions. Please upload demo urgent.


SK Suriya Kalidoss Syncfusion Team April 16, 2018 12:07 PM UTC

Hi Douglas, 
 
We had analyzed your query. We have prepared sample based on your requirement. We have attached working sample for your reference and you can download it from the below link. Please let us know if you require further assistance. 
 
 
Regards, 
Suriya K 


Loader.
Live Chat Icon For mobile
Up arrow icon