Hi,
How can I mark a certain row as "CannotBeDeleted" ?I was looking for something like e.Row.AllowDelete = FALSE but nothing like that is available, as is in the override.AllowDelete in the Initilize_Layout ...---> It **can** be edited though ... so the e.Row.Cells["Closed"].Activation = Activation.XXXXX will not do it for me
//Coloring the tasks correctly:
if ((bool)e.Row.Cells["MileStone"].Value == true)
{
e.Row.Appearance.BackColor =
Color.Chocolate;
e.Row.ToolTipText =
"Milestone Task";
e.Row.XXXX = ????
}
Even better solution:private void _ugStatusRecovery_BeforeRowsDeleted(object sender, Infragistics.Win.UltraWinGrid.BeforeRowsDeletedEventArgs e) { foreach( UltraGridRow row in e.Rows ) { if ((bool)row.Cells["MileStone"].Value == true ) { e.Cancel = true; MessageBox.Show("Milestones cannot be deleted from the RecoveryPlanner system!", "Cannot delete a Milestone", MessageBoxButtons.OK, MessageBoxIcon.Information); //throw new InvalidOperationException("You cannot delete a Milestone!"); } } }
Thanx - Handled like this:
private
e)
e.Rows )
)
e.Cancel =
;
);
You can use the BeforeRowsDeleted event and check if this row is going to be deleted.