¿Cómo eliminar una fila en radgridview?

// i edit a row on radgridview

   radgridview.rows[0].value = true;

// then i can not delete it.

    radgridview.rows[0].delete();

// if i try delete that row got the this exception => cannot remove objects not in the list

// but if i don't edit that row so i can delete it.

// plz help ,how to solved this problem?

preguntado el 28 de agosto de 12 a las 10:08

hi. what which radcontrols are you using - ASP.NET AJAX/WPF ??? -

my radcontrol is radgridview this is WINFORM control -

why bother to edit it, if you're going to delete it? Anyway, you cannot delete because of rowstate. Call an Acceptchanges, then delete -

1 Respuestas

You cannot change a row values using this code:

radgridview.rows[0].value = true;

El código correcto será:

radGridView1.Rows[0].Cells["Your column name"].Value = true;

As to your question about deleting a row, if the grid is data bound to a simple List you can delete the row by deleting it straight from the list and Updating the grid. Alternatively, to handle all notifications properly, the collection that you bind to should implement the IBindingList interface (you can use BindingList) and your object stored in the collection should implement the INotifyPropertyChanged de la interfaz del.

If this is not the case, let us know what exactly is your binding scenario.

Respondido el 17 de Septiembre de 12 a las 06:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.