- Home
- Forum
- Xamarin.Forms
- Data form
Data form
i tried adding the data form to a xamarin.forms project last night and it doesnt show up if its inside a stacklayout. Is that expected?
Also, how do you override the text of a label?
Thanks!
SIGN IN To post a reply.
5 Replies
DA
Danny Ackerman
April 17, 2018 10:37 PM UTC
Ah, I figured it out. I think because the content is dynamically generated, the StackLayout doesn't know how to show it properly. I changed to a grid and its fine.
SV
Srinivasan Vasu
Syncfusion Team
April 18, 2018 09:52 AM UTC
Hi Danny,
Thanks for contacting Syncfusion support.
We have checked your query and we are unable to meet your scenario “SfDataForm loading inside the StakLayout”. We have ensured this scenario with Syncfusion Product Version 16.1.0.32 and the SfDataForm working fine in our side. If SfDataForm’s dataobject is not binding properly, then the DataForm height becomes zero.
We have attached the tested sample along with this response. Please find the same from below.
If the issue still persists, please modify the provided sample along with replication procedure. It will be helpful for us to provide you better solution with high priority.
Regards,
Srinivasan
SV
Srinivasan Vasu
Syncfusion Team
April 18, 2018 09:55 AM UTC
Hi Danny,
Regading Override text of Label
Way 1:
You can change text of Label by using DataAnnotation attributes in Entity collection.
Please refer the below code example
|
// ShortName shown as text of Label
[Display(ShortName = "Collection Details")]
public string Collection
{
get
{
return collection;
}
set
{
this.collection = value;
}
} |
Way 2:
You can change text of Label using AutoGeneratingDataFormItem event.
Code example
|
dataForm.AutoGeneratingDataFormItem += DataForm_AutoGeneratingDataFormItem;
dataForm.DataObject = new ContactsInfo();
private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
{
if (e.DataFormItem != null && e.DataFormItem.Name == "Collection")
{
e.DataFormItem.LabelText = "Collection Details";
}
} |
Regards,
Srinivasan
PA
Penelope Ann Williamson
August 14, 2018 03:14 AM UTC
Thanks Danny Ackerman, this solved my problem with data form not displaying.
JN
Jayaleshwari N
Syncfusion Team
August 14, 2018 08:57 AM UTC
Hi Danny,
Thanks for the update.
We are glad to know that your problem has resolved. Please get in touch if you required further assistance on this.
Regards,
Jayaleshwari N
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
DA Danny Ackerman
- Apr 17, 2018 06:45 PM UTC
- Aug 14, 2018 08:57 AM UTC