Use ItemCommand in C # of a listview

0

I'm working with a ListView where you display the items in a cluttered list and as links . Under ListView has the "CREATE" button to insert a new item in ListView .

I was able to make, when I edit any list item by clicking the link button, the "CREATE" button is Enabled = false , I did this using ItemCommand ListView as in the code below. The problem is that I wanted to not allow the user to do an edit of another item when it is inserting a new one, any tips?

The "CREATE" button is outside of ListView .

protected void lvDiagnosticos_ItemCommand(object sender, ListViewCommandEventArgs e)
{
    if (e.CommandName == "Edit")
    {
        criarDiagnostico.Enabled = false;
    }
    else
    {
        criarDiagnostico.Enabled = true;
    }
}
    
asked by anonymous 10.02.2015 / 19:09

1 answer

0

I did not understand 100% the process of inserting a new item that you are using, but apparently it seems to me that during this process you would change the property LabelEdit to False . Anyway, I also suggest you take a look at the link below, which shows a custom control, which can give you more flexibility for what you are looking for.

In-place editing of ListView subitems.

    
23.02.2015 / 04:51