Delete Row in unbound list

  • ccrunner863 2 years, 7 months ago

    I’m new to c1 and I am having trouble deleting a row in an unbound list. It seems like this should be a simple operation, but I’m having quite a bit of trouble with it.

    I have tried the following calls on my "deleteItem" method. This is a simple windows forms app in c#

    this.C1List1.Refresh();
    this.C1List1.Rebind();
    this.C1List1.ClearSelected();

    Thank You!

  • 59p
    richas59p 2 years, 7 months ago

    Hello,

    If you need to remove an Item from an Unbound List, you can use the RemoveItem method available in C1List Methods.

    Here is the sample code for doing the same:

    private void DeleteBtn_Click(object sender, EventArgs e)
    {
    // Remove the Selected Item from the List
    if(c1List1.SelectedIndex != -1)
    this.c1List1.RemoveItem(this.c1List1.SelectedIndex);
    else
    MessageBox.Show("Select an item from the list first !!", "List");
    }

    Please find the attached sample for the implementation of the same.

    Let me know if you have any further queries.

    Thanks,
    Richa

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.