Articles in this section
Category / Section

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

1 min read

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

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied