Hi
How to remove selected row from UltraGrid ??
try
//true to show prompt to delete otherwise false will not show
this
.ultraGrid.Rows[this.ultraGrid.ActiveRow.Index].Delete(true);
This doesnt work .. The active row is not deleted using this code.. Is there any alternate solution .. I was trying
Selected.Rows.AddRange((UltraGridRow[])this.parsedDataList.Rows.All);.DeleteSelectedRows(false);
This is not working as well.
you want to delete only the active row.. or a range .. of rows?
I want to delete all the selected rows(range) from UltraGrid
foreach
(UltraGridRow row in this.grid.Selected.Rows)
{
row.Delete(false
);
}
Sorry no. I cant see any other without trigger an event.
Thanks for your reply. PerformAction does remove all the selected rows from UltraGrid but it triggers another event Afterselectchange which shud be avoided. Is there any way to do it
try this:
grid.PerformAction(
UltraGridAction.DeleteRows);
i think this way will work. there are a lot of actions that you can use there for further development.
I am using your code. When I select from Grid 5 rows .. .UltraGrid.Rows.Count shows 5 but when i am looping the UltraGrid .. It just iterates 4 times .. Is .UltraGrid.Selected.Rows leaving out Active row ??
you are using the same code that i posted? can you see if the amount of rows that you selected is the same that appears in the Selected.Rows Collection?
i think the method Delete() returns a boolean .. see if you can get .. the last return value.. see if is false.