Hi,
If the row is matching a specific condition (datacell value to some constant value) then these row should be selected otherwise not.
Please let me know, how to achieve this?
Thanks,
Ganesh.
Many Thanks Trausti and Chris,
It is worked in one project but not in the other (need to dig more for that).
I am having another problem. How to make checkbox enable on row with readonly data.
To enable checkbox to select/deselect but it will enable the row for editing.
Me
.ug.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.[False]
so How to enable the checkbox without enabling row editing.
Ganesh
Hello Ganesh,
Trausti's response is correct. In the AfterHeaderCheckStateChanged event handler, you will want to loop through the RowsCollection provided by the EventArgs, and select any that match the cell value you are looking for.
You might want to make sure the HeaderCheckBoxSynchronization is set to None to prevent the cell values from changing when the checkbox is clicked.
Let me know if you need further assistance.
Chris
Something like this could work:
Private Sub grd_AfterHeaderCheckStateChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.AfterHeaderCheckStateChangedEventArgs) Handles grd.AfterHeaderCheckStateChanged Dim row As UltraWinGrid.UltraGridRow
'Clear current row selection grd.Selected.Rows.Clear()
If e.Column.GetHeaderCheckedState(e.Rows) = CheckState.Checked Then 'The check is on: Select rows that meet criteria For Each row In grd.Rows If row.Cells(e.Column).Value = 1 Then row.Selected = True End If Next End If
End Sub
Trausti