HelloI have a grid with diferent cell activation situations.Some columns has cellactivation = NoEdit but only for the preload data. The added cells allow edition.I use the .IgnoreRowColActivation for allow the cell edition. I wonder if is possible to know if a cell is editable or not, just watching the cell properties.
I.E.
dt = New DataTable dt.Columns.Add("NAME", System.Type.GetType("System.String")) dt.Columns.Add("NUMBER", System.Type.GetType("System.String")) dt.Rows.Add("One", "1") dt.Rows.Add("Two", "2") dt.Rows.Add("Three", "3") dt.Rows.Add("Four", "4") dt.Rows.Add("Five", "5") bandera = False With ug1 .DataSource = dt 'COLUMN NOEDIT .DisplayLayout.Bands(0).Columns(0).CellAppearance.BackColor = Color.LightGray .DisplayLayout.Bands(0).Columns(0).CellActivation = UltraWinGrid.Activation.NoEdit 'NEW ROW Dim oRow As UltraWinGrid.UltraGridRow = ug1.DisplayLayout.Bands(0).AddNew() 'Override the Activaction oRow.Cells(0).IgnoreRowColActivation = True oRow.Cells(0).Activation = UltraWinGrid.Activation.AllowEdit oRow.Cells(0).Appearance.BackColor = Color.LightSalmon oRow.Cells(1).IgnoreRowColActivation = True oRow.Cells(1).Activation = UltraWinGrid.Activation.AllowEdit oRow.Cells(1).Appearance.BackColor = Color.LightSalmon End With
In the 1st pic I check a preload cell (not editable) and in 2nd i check a new row's cell. Has the same values properties but the 2nd one is editable.
You will also need to track when a new row is committed to the grid and turn off IgnoreRowColActivation, because otherwise, this setting will stick with the cell and override the column setting.
So you probably need to trap AfterRowUpdate and set IgnoreRowColActivation back to false and perhaps Reset the Activation property on the cell.
If that doesn't help, then please post a small sample project demonstrating the problem so I can check it out.
Hi Mike
The cell.Row.IsAddRow works for the news cells, but what if I want to edit a preload cell? if I add this code .DisplayLayout.Rows(0).Cells(0).IgnoreRowColActivation = True .DisplayLayout.Rows(0).Cells(0).Activation = UltraWinGrid.Activation.AllowEdit I can edit the first cell, but the cell activation is the same than the others
Hi,
I'm guessing that the last cell is editable because it's in the AddRow or TemplateAddRow. So you could check cell.Row.IsAddRow or cell.Row.IsTemplateAddRow.