C# : Tutorial of Asp.net with c# and example

Example and code about windows application, web application, SQL, C#, WPF etc which is helpful to developer and programer.

Search This Blog

Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

How to bind data in checkboxlist control of asp.net? and property of checkboxlist control

♠ Posted by uvesh in ,

Checkboxlist: Creates a multi selection check box group that can be dynamically created by binding the control to a data source.

Data bind in CheckBoxList in asp.net following code for aspx page

 <asp:CheckBoxList ID="CheckBoxList1" runat="server"
   DataSourceID="SqlDataSource1" DataTextField="text" DataValueField="text">
  </asp:CheckBoxList>


Data Bind in CheckBoxList in asp.net following Code write in Code behind page



if (!IsPostback)
{

CheckBoxList1.DataSource = dataset/datatable/datasource;
CheckBoxList1.DataTextField = "tex";
CheckBoxList1.DataValueField = "text";
CheckBoxList1.DataBind();

}

Use Full Property pf asp ListBox control as follow:

AppendDataBoundItems, AutoPostBack, CausesValidation, DataTextField, DataTextFormatString, DataValueField, Items, runat, SelectedIndex, SelectedItem, SelectedValue, TagKey, Text, ValidationGroup, OnSelectedIndexChanged

Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/