Hi, I'm using WinGrid version 10.2 and have one or more boolean type columns in my grid. The TemplateAddRow is showing checkboxes (column.style = ColumnStyle.Checkbox) for the boolean columns. Is there any way to hide the checkboxes until the TemplateAddRow becomes the active row?
Thanks.
This seems to work:
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { foreach (UltraGridCell cell in e.Row.Cells) { if (cell.Column.DataType.IsAssignableFrom(typeof(bool))) cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit; } } private void ultraGrid1_InitializeTemplateAddRow(object sender, InitializeTemplateAddRowEventArgs e) { foreach (UltraGridCell cell in e.TemplateAddRow.Cells) { if (cell.Column.DataType.IsAssignableFrom(typeof(bool))) cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Image; } }
Hi,
There's no automatic way to do this, but you could handle it using events or maybe a CreationFilter.
It's tough to offer you any specifics without know what your AllowAddNew property is set to. Where the TemplateAddRow is positioned and whether or not it's fixed might matter.
But most likely, you can use InitializeRow and check the state of the row by looking at IsAddRow, IsTemplateAddRow and IsUnmodifiedTemplateAddRow (on the row) and then set the Style on the cells for that row.