Can't SfDataForm be defined using XAML?

SfDataForm seems great as it seems to support INotifyDataError.
Would it be possible to use it with SfTextInputLayout and define the whole page using XAML?

First time SyncFusion user here! Am I missing something?

8 Replies

JN Jayaleshwari N Syncfusion Team October 19, 2018 12:24 PM UTC

Hi Jean, 
 
Thanks for Contacting Syncfusion Support. 
 
We have checked the reported query “Can't SfDataForm be defined using XAML?” from our side. You can define the SfDataform in XAML and its does not support to define the editor in XAML itself. You can only achieve your requirement programmatically by using CustomEditor. 
 
We have attached the simple sample with SfDataForm defined in XAML and you can download the same form the following location. 
 
 
You can load the SfTextInputLayout as new custom editor as like we have documented about this in the following location. 
 
 
Please let us know if you would require further assistance. 
 
Regards, 
Jayaleshwari N 



PG Piotr Grzywa October 29, 2018 11:15 AM UTC

I have some problem with that sample  .
If use Navigation page  MainPage = new  NavigationPage(new MainPage());
and my xml is like :

   
       
       
   " 
       
       
           
      
       
 
Dataform  does not show up.





PG Piotr Grzywa October 29, 2018 11:17 AM UTC

I have some problem with that sample  .
If use Navigation page  MainPage = new  NavigationPage(new MainPage());
and my xml is like :

<ContentPage.Content>
        <StackLayout Orientation="Vertical" >
        <dataForm:SfDataForm x:Name="dataForm"  DataObject="{Binding Contact}"/>
            <Button Text="OK"   />
        </StackLayout>
    </ContentPage.Content>

Dataform  does not show up.





PG Piotr Grzywa October 29, 2018 11:24 AM UTC

I have some problem with that sample  .
If use Navigation page  MainPage = new  NavigationPage(new MainPage());
and my xml is like in attachment  :

Dataform  does not show up.




Attachment: SfDataFormSample_8f5cb008.zip


PG Piotr Grzywa October 29, 2018 12:00 PM UTC

After many tests, I discovered that it works correctly in Xamarin.Forms 2.4.0.280


SG Swathi Gopal Syncfusion Team October 31, 2018 03:57 AM UTC

  
Hi Piotr, 
 
We have checked with your query regarding SfDataForm not arranging properly when SfDataForm is added along with other control in the stackLayout in Xamarin Forms. We are not able to reproduce the issue in our side. However, for Xamarin Forms platform, if dataform is added in StackLayout, dataform VerticalOptions and HorizontalOptions need to be set as FillAndExpand to layout. Based on the provided code snippet, we have prepared a sample for the same. Kindly find the sample below, 
 
Sample: TextInputSample
 
 
Could you please check with the provided sample whether the mentioned issue is reproduced? If not, kindly modify the sample attached and revert us back with more details regarding your query. Such that it will be helpful for us to provide you solution. 
 
Regards, 
Swathi G 



PG Piotr Grzywa November 6, 2018 01:20 PM UTC

Thanks   VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"  helped in my case.
Regards.
Piot Grzywa


VR Vigneshkumar Ramasamy Syncfusion Team November 7, 2018 06:41 AM UTC

Hi Piot Grzywa, 
 
We glad to know that your requirement has been achieved. Please get in touch if you required further assistance on this. 
   
Regards 
Vigneshkumar R 


Loader.
Up arrow icon