Solved

Multi select control for ASP.NET

Posted on 2008-06-10
6
1,223 Views
Last Modified: 2012-05-05
Is there an available control for ASP.NET that has features for multi select?
I passing data to an aspx form and I would liek to see a control with checkboxes so I can multiselect on the records or data. thanks
0
Comment
Question by:zachvaldez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 21755000
There are a couple in the default asp.net control set:

The Listview control allows you to select multiple items by shift-clicking and ctrl-clicking them.
The CheckboxList allows you to select multiple items by checking each one
 
0
 

Author Comment

by:zachvaldez
ID: 21756396
Can you show me an example how to do a checklistbox?
I have a select statement- Select ID,Last,First,Address,Cit,State,Zip and it returns 20 items/records.
Id like to put a multiple checkbox so I can mass-process it. thanks
0
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 21764067
here is an article on using the checklistbox

http://www.developerfusion.co.uk/show/14/1/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zachvaldez
ID: 21765655
Thanks , I check the link and there is not much about checklistbox. I think the Gridview is a better alternative as I tried to explore its features but I m not yet fully understanding of Gridview's ability to provide an array of checlboxes  to match the number of records coming from a dataset or query.
Are you familiar with Gridview and how can it be implemented here?
0
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 300 total points
ID: 21766076
sure you can use a gridview with a checkbox column, that would make it easier to have multiple columns as per your select statement, but you wont be able to get a collection of checked items without looping through all the rows and seeing if the box is checked.

just design your gridview in the designer and then in the code behind check if the boxes are checked.


pseudocode to give the idea of looping through the rows

for each row in gridview.rows
{
      //get the cell value for your checkbox column for this row
      bool isChecked = row.cells[checkboxColumnIndex]

      if (isChecked = true) then do whatever it is that you do with checked rows

}

0
 

Author Comment

by:zachvaldez
ID: 21783746
I work with VB.NET. thanks anyways
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question