Hi,
I am using wingrid’s new feature that allow to check all the rows with the header click. I have noticed one thing that whenever I want to uncheck all the rows, I have to uncheck header check box twice in order to remove the selection from header however all the rows are getting unchecked with single click. Is this bug or I am missing nay property. Below is the code which I am using in InitilizeLayout () function:
I have also attached sample attachment.
Thanks,
With e.Layout
If .Bands(0).Columns.Exists("Select") Then
.Bands(0).Columns.Remove(
"Select")
End If
.Bands(0).Columns.Add(
"Select", "")
.Bands(0).Columns(
"Select").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox
"Select").Header.CheckBoxVisibility = Infragistics.Win.UltraWinGrid.HeaderCheckBoxVisibility.WhenUsingCheckEditor
"Select").Header.CheckBoxAlignment = Infragistics.Win.UltraWinGrid.HeaderCheckBoxAlignment.Center
"Select").Header.CheckBoxSynchronization = Infragistics.Win.UltraWinGrid.HeaderCheckBoxSynchronization.Default
End With
Hello,
Based on your description of the problem and the code you provided, I'm unable to tell exactly why it takes two clicks of the header checkbox to uncheck all of the affected cells. The CheckState should toggle from Indeterminate, Unchecked, Checked, Unchecked, etc.
One thing I noticed that may be causing the issue you are encountering is due to the DataType of the column. The default DataType of a new column is String. For performance purposes, the synchronization code does not attempt to convert String value to Boolean. By setting the DataType property on the column to Boolean, the synchronization code should work appropriately.
.Bands(0).Columns("Select").DataType = Type.GetType("Boolean")
Let me know if setting the DataType on the column helps to resolve your issue. Otherwise, we will have to take a closer look at your implementation.
Chris
I am also experience the same behavior.
I have added this code:grid.DisplayLayout.Bands[0].Columns["Selected"].DataType = typeof(bool);
this.DisplayLayout.Bands[0].Columns["Selected"].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always;
this.DisplayLayout.Bands[0].Columns["Selected"].Header.CheckBoxSynchronization = HeaderCheckBoxSynchronization.RowsCollection;
this.DisplayLayout.Bands[0].Columns[columnName].SortIndicator = SortIndicator.Disabled;
First time you click on the check nothing happens. Second time checkbox is selected.