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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the edited text and the index of the edited row in WinForms EditableList?

Platform: WinForms |
Control: EditableList

EditableList events

You need to handle the ItemChanging and the ListItemDraw events inorder to get the new text and the index of the edited row.

C#

this.editableList1.ListItemDraw += new Syncfusion.Windows.Forms.Tools.ListItemDrawEventHandler(this.editableList1_ListItemDraw);
this.editableList1.ItemChanging += new Syncfusion.Windows.Forms.Tools.ListBoxTextChangingEventHandler(this.editableList1_ItemChanging);
private void editableList1_ItemChanging(object sender, Syncfusion.Windows.Forms.Tools.ListBoxTextChangingEventArgs e)
{
    //This Event is fired when the user completes editing a row.
    //e.NewText gives you the text edited
    Console.WriteLine (e.NewText.ToString () );
}
private void editableList1_ListItemDraw(object sender, Syncfusion.Windows.Forms.Tools.ListItemDrawEventArgs args)
{
    //this.editableList1.Editing Indicates whether the current row is being edited
    //args.Index gives you the index of the edited row.
    if(this.editableList1.Editing &&args.Selected)
    {
       Console.WriteLine ("index of Edited Item"+ args.Index );
    }
}

 

VB

Me.editableList1.ListItemDraw += New Syncfusion.Windows.Forms.Tools.ListItemDrawEventHandler(Me.editableList1_ListItemDraw)
Me.editableList1.ItemChanging += New Syncfusion.Windows.Forms.Tools.ListBoxTextChangingEventHandler(Me.editableList1_ItemChanging)
Private Sub editableList1_ItemChanging(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.ListBoxTextChangingEventArgs)
    'This Event is fired when the user completes editing a row.
    'e.NewText gives you the text edited
    Console.WriteLine(e.NewText.ToString)
End Sub
Private Sub editableList1_ListItemDraw(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.ListItemDrawEventArgs)
    'this.editableList1.Editing Indicates whether the current row is being edited
    'args.Index gives you the index of the edited row.
    If Me.editableList1.Editing AndAlso args.Selected Then
        Console.WriteLine("index of Edited Item" + args.Index.ToString())
    End If
End Sub

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile