Hi Subha,
Thanks for Contacting Syncfusion Support.
We have checked the reported query “How to inline edit SfListView items during runtime?” from our side. You can achieve your requirement by loading Editor in SelectedItemTemplate with OneWay binding mode for particular property to avoid immediate update to property. And explicitly set the editor value to bound object when editor is unfocused using editor events.
Code snippet XAML: Editor will be loaded when tap on the listview item.
<syncfusion:SfListView.SelectedItemTemplate>
<DataTemplate>
<Editor x:Name="editorContactName" Text="{Binding ContactName, Mode=OneWay}">
<Editor.Behaviors>
<local:EditorBehavior/>
</Editor.Behaviors>
</Editor>
</DataTemplate>
</syncfusion:SfListView.SelectedItemTemplate> |
Code snippet C#: Editor value will be committed when you click outside
public class EditorBehavior : Behavior<Editor>
{
private void OnEditorUnfocused(object sender, FocusEventArgs e)
{
var editor = sender as Editor;
var bindingContext = editor.BindingContext as Contacts;
bindingContext.ContactName = editor.Text;
}
} |
We have attached the sample for your reference and you can download the same from the following location.
Note: LsitView can show case multiple property binding in ItemTemplate and using virtualization concept. So, you need to handle the each property for editing. You can refer our SfDataGrid for inline editing which supports editing and validation with templates.
Please let us know if you would require further assistance.
Regards,
Jayaleshwari N.