Hi,
I am adding a CheckBox column to my wingrid at runtime. How can I make it default to 'false' as opposed to the filled in square of 'null'? Right now I am looping through each cell and setting it to False. This is also marking the row as "edited". Does anyone know a better way? Here is my code so far:
Infragistics.Win.UltraWinGrid.UltraGridColumn completedColumn;
completedColumn.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
{
}
Looping through the rows is certainly not the best way to do it.
The best way is probably to do it on the data source. What kind of data source are you using? Most data sources, like a DataTable or UltraDataSource let you specify a default value for a column.
Another way to do it would be to use the InitializeRow event of the grid, rather than looping.
I am just googling on Default value for CheckBox Column and found this post .
If I apply the same thing on InitializeRow event then It will fire the AfterRowUpdate, AfterCellUpdate and Other event.
I want the same thing without fire the AfterRowUpdate, AfterCellUpdate and other event on InitializeRow event.
Kindly suggest.
Vijay
Hi Vijay,
No matter what event you use, the events will always fire. There is no way around that.
So you will either need to establish a default value for the field in your data source before binding to the grid.
Or, you could unhook the events or use the EventManager to disable those events and then loop though the rows.
Hi Mike,
I want checkbox is check by default when ultragrid is loaded can we do setting in properties?