Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Select All CheckBox

I am having 5 checkboxes in my screen(user screen). In that 5th checkbox is SelectAll checkbox..By selecting that Checkbox all the other 4 got checked..what i want is, incase if i want to uncheck any checkbox, it should get unchecked by clicking that particluar checkbox...How to do this.....Here is my source in item event...

Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
Try
If pVal.BeforeAction = False Then
Conv_Form.Freeze(True)
Dim ChkSelectAll As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chkAll").Specific
Dim Chk1 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk1").Specific
Dim Chk2 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk2").Specific
Dim Chk3As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chkAC").Specific
Dim Chk4As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk4).Specific
If ChkSelectAll.checked = True Then
Chk1.Checked = True
Chk2.Checked = True
Chk3.Checked = True
Chk4.Checked = True
Else
Chk1.Checked = False
Chk2.Checked = False
Chk3.Checked = False
Chk5.Checked = False
ChkSelectAll.Checked = False
End If
Conv_Form.Freeze(False)
Catch ex As Exception
Conv_Form.Freeze(False)
End Try

replied

If pVal.BeforeAction = False Then

Conv_Form.Freeze(True)

Dim ChkSelectAll As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chkAll").Specific

Dim Chk1 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk1").Specific

Dim Chk2 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk2").Specific

Dim Chk3As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chkAC").Specific

Dim Chk4As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk4).Specific

If ChkSelectAll.checked = True Then

Chk1.Checked = True

Chk2.Checked = True

Chk3.Checked = True

Chk4.Checked = True

Else

ChkSelectAll.Checked = False

Chk1.Checked = False

Chk2.Checked = False

Chk3.Checked = False

Chk5.Checked = False

End If

Conv_Form.Freeze(False)

Catch ex As Exception

Conv_Form.Freeze(False)

End Try

hi

just changed cheselectall.checked to the next of else

regards

micheal

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question