Skip to content

Commit 502d9d1

Browse files
authored
ReadMe file updated with Kb details.
1 parent 5cde116 commit 502d9d1

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# numeric-editor-group-separator-dataform-xamarin
2-
How to remove a thousand separators in the numeric text field in Xamarin.Forms DataForm (SfDataForm)
1+
# How to remove a thousand separators in the numeric text field in Xamarin.Forms DataForm (SfDataForm)
2+
3+
You can disabled the thousand seperators for numeric editor in Xamarin.Forms [SfDataForm](https://help.syncfusion.com/xamarin/dataform/getting-started?) by using [EnableGroupSeparator](https://help.syncfusion.com/xamarin/numeric-entry/number-formatting?_ga=2.17119792.843378045.1589170218-1204678185.1570168583#set-enablegroupseparator) property.
4+
5+
Refer to the [online user guide documentation](https://help.syncfusion.com/xamarin/dataform/working-with-dataform?_ga=2.17994672.843378045.1589170218-1204678185.1570168583#auto-generating-dataformitems-for-the-data-field) for customize the editor in DataForm using [AutoGeneratingDataFormItem](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfDataForm.XForms~Syncfusion.XForms.DataForm.SfDataForm~AutoGeneratingDataFormItem_EV.html?) event.
6+
7+
You can also refer to the following article.
8+
9+
https://www.syncfusion.com/kb/11527/how-to-remove-a-thousand-separators-in-the-numeric-text-field-in-xamarin-forms-dataform
10+
11+
**C#**
12+
13+
Set the **EnableGroupSeparator** property into false inside the **AutoGeneratingDataFormItem** event.
14+
15+
``` xml
16+
public class DataFormBehavior : Behavior<ContentPage>
17+
{
18+
SfDataForm dataForm;
19+
protected override void OnAttachedTo(ContentPage bindable)
20+
{
21+
base.OnAttachedTo(bindable);
22+
dataForm = bindable.FindByName<SfDataForm>("dataForm");
23+
dataForm.AutoGeneratingDataFormItem += DataForm_AutoGeneratingDataFormItem;
24+
}
25+
private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
26+
{
27+
if (e.DataFormItem != null)
28+
{
29+
if (e.DataFormItem.Name == "BirthYear")
30+
{
31+
(e.DataFormItem as DataFormNumericItem).EnableGroupSeparator = false;
32+
}
33+
}
34+
}
35+
protected override void OnDetachingFrom(ContentPage bindable)
36+
{
37+
base.OnDetachingFrom(bindable);
38+
dataForm.AutoGeneratingDataFormItem -= DataForm_AutoGeneratingDataFormItem;
39+
}
40+
}
41+
```

0 commit comments

Comments
 (0)