Asp.net CheckBoxList control

omidMustefa 235 views 6 slides Jan 01, 2022
Slide 1
Slide 1 of 6
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6

About This Presentation

Asp.net CheckBoxList control
lecturer: Omeed Mustafa Mohammed
institute: Da Vinci institute (duhok)


Slide Content

ASP.NET CheckBoxList Control Department of Computer WEB – GRADE 5 Lecturer. OMEED M. M Lecture 8

CheckBoxList Control CheckBoxList is collection of ListItem objects. How we can add items to the checkboxlist ? Items can be added to the CheckBoxList in the HTML source or in the code behind file. 12/14/2021 Mr.Omeed M. M 2

Important Properties of the CheckBox Control 12/14/2021 Mr.Omeed M. M 3 This is CheckBoxList This is collection of single CheckBox

Adding items through HTML source 12/14/2021 Mr.Omeed M. M 4 < asp:CheckBoxList ID=" checkboxListEducation " runat ="server"              RepeatDirection ="Horizontal">     < asp:ListItem Text="Diploma" Value="1"></ asp:ListItem >     < asp:ListItem Text="Graduate" Value="2"></ asp:ListItem >     < asp:ListItem Text="Post Graduate" Value="3"></ asp:ListItem >     < asp:ListItem Text=" Doctrate " Value="4"></ asp:ListItem > </ asp:CheckBoxList > < br /> < asp:Button ID="Button1" runat ="server" Text="Button" onclick ="Button1_Click" />

Important Properties of the CheckBox Control 12/14/2021 Mr.Omeed M. M 5 RepeatColumns  property specifies the number of columns used to lay out the items. SelectedIndex property  of the CheckBoxList control can also be used to get the index of the selected item in the checkboxlist . But this property, returns only one selected item, and that too, the item with the lowest index. SelectedIndex property returns -1, if nothing is selected. SelectedValue property  returns the selected Item's value, but only for one selected item. If no item is selected this property returns empty string.

Any Questions ? 12/14/2021 6 MR. OMEED M. MOHAMMED