I would like certain rows in an Ultragrid to be disabled depending on a boolean Sync property in the row. I have thought of two different solutions but neither have worked out.
1) Databind the Sync property to the Activation property of the row. Is this possible?
2) In an event such as the InitializeRow event of the grid find out what the Sync property is and disable the row if it is set to true. This method works apart from if some more rows are then added to the grid and the grid is then saved, the data reorders itself so that the disabled row isn't containing the right data. Therefore I need a way of knowing when this happens so that I can go through and disable the right rows again afterwards.
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
e.Row.Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
if (e.Row.Cells[grdBoundGrip.DisplayLayout.Bands[0].Columns["Sync"]].Value != null && (bool)e.Row.Cells[grdBoundGrip.DisplayLayout.Bands[0].Columns["Sync"]].Value)
e.Row.Activation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
}