Private Sub aCheckBoxOnHeader_CreationFilter_HeaderCheckBoxClicked(ByVal sender As Object, ByVal e As CheckBoxOnHeader_CreationFilter.HeaderCheckBoxEventArgs) Handles aCheckBoxOnHeader_CreationFilter.HeaderCheckBoxClicked If e.Header.Column.Key = "Lsele" Then Dim Cvalue As String Dim drdepts As DataRow Dim I As Integer Dim rposition As CurrencyManager rposition = CType(Me.BindingContext(DsINV_AssetsDepreciation_Lookup.INV_AssetsDepreciation_Lookup), CurrencyManager) Me.DsINV_AssetsDepreciation_Lookup.GetChanges() rposition.Position = 0 I = 0 Cvalue = e.Header.Column.ToString Me.GrdlAssetDepreciation.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.FirstRowInGrid) If Cvalue = "Lsele" Then If e.CheckState = CheckState.Unchecked Then Me.Fill_Refresh_Grid() Me.AssetDepreciationPKList.Clear() Me.AssetPKList.Clear() I = 0 Else For Each drdepts In Me.dv.Table.Rows drdepts("Lsele") = 1 AssetDepreciationPKList.Add(drdepts("AssetsDepreciationPK")) AssetPKList.Add(drdepts("AssetsFK")) If I < Me.GrdlAssetDepreciation.Rows.Count Then With Me.GrdlAssetDepreciation.Rows(I).Appearance .BackColor = My.Settings.Color4 .BackColor2 = My.Settings.Color4 End With I = I + 1 End If Next drdepts Me.Add_btn.Focus() End If Dim xx As Integer System.Math.DivRem(Me.GrdlAssetDepreciation.Rows.Count, 2, xx) If xx > 0 Then If I = 0 Then SetEditDeleteButtons(False) checkcount = 0 Else SetEditDeleteButtons(True) checkcount = Me.GrdlAssetDepreciation.Rows.Count End If Else If I = 0 Then SetEditDeleteButtons(False) checkcount = 0 Else SetEditDeleteButtons(True) checkcount = Me.GrdlAssetDepreciation.Rows.Count End If End If Me.GrdlAssetDepreciation.Refresh() End If End If End Sub