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.
Unfortunately, activation email could not send to your email. Please try again.

How can I get the edited text and the index of the edited row?

 

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

Article ID: Published Date: Last Revised Date: Platform: Control:
1550 04/30/2011 07/10/2014 Windows Forms EditableList
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.