Dear all,
I have the ultragrid that show the checkbox in the cell.
How can I disable the cell when the checkbox is checked??
What is the event?? What is the steps to do this as below??
(1) Create the event and assign the event to the ultragrid??(STEPS)
(2) e.g. On Databound, when cell.value==true, disable it. (ANY SAMPLE CODE??)
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
if ((bool)e.Row.Cells[0].Value)
e.Row.Cells[0].Activation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
}
private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
if ((bool)e.Cell.Value && e.Cell.Column.Key == "")
e.Cell.Activation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
I am using below code. But find that when I checked, it becomes disabled also.
I want only on one time display (disabled the field if they are true in the datasource) when opening the form. On other non-Checked checkbox, when I checked it, it still enabled. As this status is important for me to process when I click OK button on the form. as I will ignore the disabled checkbox field.
Could you tell me how to do??
----------------------------------------------------------------------------------
The InitializeRow event doesn't just fire the first time the row is created, it also fires any time any value in the row is changed. This makes it ideal for changing the format or appearance of a cell or row based on the value in a cell.
In your case, if you only want to disable the cell in the initial creation of the row, then you should check that e.ReInitialize is false. This will indicate that it's the creation of the row that is causing it to be initialized.