2011-03-06 8 views

Respuesta

15

Intente utilizar un ListView control, en su lugar.

Establezca su LabelEdit property en True para permitir que el usuario edite los nombres de los elementos.


para permitir al usuario para editar el texto de un elemento recién insertado, puede utilizar el siguiente código:

private void AddItemToListView() 
{ 
    // Add a new item to the ListView, with an empty label 
    // (you can set any default properties that you want to here) 
    ListViewItem item = listView1.Items.Add(String.Empty); 

    // Place the newly-added item into edit mode immediately 
    item.BeginEdit(); 
} 
+0

Si hay varias columnas, http://msdn.microsoft.com /en-us/library/system.windows.forms.datagridview.aspx podría ser una buena opción también. :-) –

+0

¿Puedo hacer que el elemento listview se pueda editar cuando lo inserte? – voldyman

+0

@akshay: He editado mi respuesta con información nueva. Eso debería hacer exactamente lo que quieras. –

Cuestiones relacionadas