1

How to add checkbox inside the listbox. Where ChechBoxList controls is not good for more records, By using listbox user can easily scroll to choose the item.

Geetha.

0

3 Answers 3

5

What you want is the

CheckBoxList.

Newer CheckBoxList

Pretty nice step-by-step here.

Sign up to request clarification or add additional context in comments.

1 Comment

The step-by-step link is broken.
2

what about checkedListBox ?

<asp:CheckBoxList id="checkboxlist1" runat="server"> 
         <asp:ListItem>Item 1</asp:ListItem>
         <asp:ListItem>Item 2</asp:ListItem>  
         <asp:ListItem>Item 3</asp:ListItem>          
</asp:CheckBoxList>

To access items on user action

void checkboxlist1_Clicked(Object sender, EventArgs e) 
{          
   if (checkBoxList1.SelectedIndex == 1)
   {
       // DoSomething  
   }      
}

1 Comment

That's CheckBoxList, not checkedListBox.
-1
<ListBox x:Name="targetList" ItemsSource="{Binding}">

<ListBox.ItemTemplate>

<HierarchicalDataTemplate>

<StackPanel Orientation="Horizontal">

<CheckBox>

<TextBlock Text="{Binding Path=Name}"/>

</CheckBox>

</StackPanel>

</HierarchicalDataTemplate>

</ListBox.ItemTemplate>

</ListBox>

1 Comment

Original Poster (OP) was asking for ASP.NET solution - please read the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.