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

Binding sfDataForm to a list

Thread ID:

Created:

Updated:

Platform:

Replies:

142902 Feb 25,2019 02:15 PM UTC Mar 6,2019 05:25 PM UTC Xamarin.Forms 7
loading
Tags: SfDataForm
imc
Asked On February 25, 2019 02:15 PM UTC

Hello,

I'm trying to bind the sfDataForm to a List.
The list contains only strings (List<string>()).
Now what I'd like to do is to change the editor for each element of that list, like Date or Time editor.
What I tried is to convert the value in the OnSet and convert it back in the OnGet method. That doesn't work and it gives me an exception.
I used the https://help.syncfusion.com/xamarin/sfdataform/working-with-dataform#manually-generate-dataformitems-for-data-dictionary example as a start.
How would I add a converter to each value?

Kind regards.

Jayaleshwari N [Syncfusion]
Replied On February 26, 2019 01:15 PM UTC

Hi Cyril,  
  
Thanks for contacting Syncfusion Support.  
  
Based on the provided information, we have created a sample by manually generating dataform items such that for each dataform item editor can be set in the GenerateDataFormItems override method in SfDataForm Xamarin Forms and you can refer from the following location.  
 
Sample link: DemoSample
  
 
If this solution doesn’t meet your requirement, kindly modify the sample along with more explanation about your requirement. Such that it will be helpful for us to provide you possible solution.  
 
Regards, 
Jayaleshwari N. 


imc
Replied On February 26, 2019 02:47 PM UTC

Hello and thank you very much for the sample.

Although that's how far I got. My problem now is, if I changed the Sample dictionary to be of type Dictionary<string, string>() I get an error as I have Time- or DateEditor defined. Because it can't cast from DateTime to string. 
What I would like now is that I can define an editor myself and 'bind' it to a string property. Thus, according to your page, I need an IValuePropertyConverter. How do I convert the value on the fly?



Jayaleshwari N [Syncfusion]
Replied On February 27, 2019 11:33 AM UTC

Hi Cyril,  
  
Thank you for the update.  
Currently, we are analyzing your query, and we will update you further details about this on or before March 1, 2019. We appreciate your patience until then.  
  
Regards,  
Jayaleshwari N 


Arun siva [Syncfusion]
Replied On March 1, 2019 02:47 PM UTC

Hi Cyril, 
 
Thank you for your patience. 
 
We have analyzed your requirement “Want to used dictionary<String,String>()” and you can achieve this in sample level, by customize the DataFormItemManager, we have prepared a simple sample for the same. 
 
Sample: SfDataForm. 
 
If the sample doesn’t meet your requirement, kindly revert us back by modifying the sample based on your scenario, which help us to analyze and resolve your requirement. 
 
Regards, 
Arun Siva R 


imc
Replied On March 3, 2019 10:15 PM UTC

Hello,

thank you for your new example.

I tried it again (Win UWP) but got an error on editing the time. That's the same that happens to me.
Why can't I just use an IValuePropertyConverter? How would I add one without attribute?

Thanks and have a nice evening.

Arun siva [Syncfusion]
Replied On March 4, 2019 12:52 PM UTC

Hi Cyril, 
 
Thank you for the update. 
 
Currently, we are analyzing your query about “Want to use dictionary<string,string>() with IValueConverter” and we will update you for this on two business days 6th March 2019. We appreciate your patience until then. 
 
Regards,
Arun Siva R 


Arun siva [Syncfusion]
Replied On March 6, 2019 05:25 PM UTC

Hi Cyril, 
 
Thank you for the update. 
 
We have analyzed your query “Want to use Dictionay<String, String>” and you can achieve this in sample level, as we have mentioned in our previous update. As you mentioned we have faced crash in this scenario, and we already found fixed this issue. The issue fix will be included in our upcoming 2019 Volume 1 release which is expected to roll out at the mid of March 2019. We appreciate your patience. 
 
Kindly revert us if you have any concern. 
 
Regards, 
Arun Siva R 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;