.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Filtering with Multiple selections (Checkbox list control)

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint
I have a scenario where there is a large list of 2000+ items, these items each have a name associated to it.

I now need to be able to filter this list by selecting the names from a Checkbox list, the problem is I cannot figure out how to get it to work when multiple values are selected.

The current setup is Using a DVWP to display the items a Datasource control of all the names and then the ASP.NET Checkbox list control to act as a filter

Can anyone help?

View Complete Post

More Related Resource Links

Object reference not set to an instance of an object in Nested Repeater Control of CheckBox List con

 if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem))
                Repeater rptsub = (Repeater)item.FindControl("rptsub");
                CheckBoxList Chksub = (CheckBoxList)rptsub.FindControl("Chksub");
                Label lblsubroot = (Label)rptsub.FindControl("lblsubroot");
                DataRowView row = (DataRowView)e.Item.DataItem;
                RootId = Convert.ToInt32(row["IdApplication"].ToString());
                MetadataPermissions metadataPermissions = new MetadataPermissions(); ;
                DataSet rptRootValues = new DataSet();
                rptRootValues = metadataPermissions.GetrptSubMenus(RootId);
                DataRow[] drows = rptRootValues.Tables[0].Select("IdApplicationroot = " + row["IdApplication"].ToString());
                foreach (DataRow chkpermsns in drows)
                   ListItem li = new ListItem(chkpermsns["PermissionName"].ToString());


<asp:Repeater ID="rptroot" runat="server" OnItemDataBound="rptroot_ItemDataBound">

SSRS 2008: Multiple Sub-Reports with conditional visibility in one List control


MainReport: a List containing two Sub-Reports. The data of the List only has two rows. Set the visibility of the sub-report based on the data.

SubReport1: a textbox showing "Sub Report 1"

SubReport2: a textbox showing "Sub Report 2"

I expect to see SubReport1 in Page 1 and SubReport2 in Page 2.

But I only see SubReport1 in Page 1 and Page 2 is a blank page.

These reports work in SSRS 2005, but not in SSRS 2008.



Report Definition:



<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner

code SQL to populate gridview with multiple random list box selections, How to


I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I need to collect the list of selected items from the drop down list and retrieve each of their full records from the item master and populate a gridview.

Any help would be greatly appreciated.


Thanks again,



SQL code to populate gridview with multiple random list box selections


I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I could really use some help building the SQL statement to select the choosen record data. I think I have the selection list worked out by populating an array but I am not clear on how to build the SQL query.

Any help would be greatly appreciated.


Thanks again

Gathering multiple values from a checkbox list.


Hey everyone!

Thanks to some help from this forum I was able to gather a value from a gridview based on a selected checkbox.  However,  I would like to be able to grab multiple values instead of just one.  I tried using a for loop to gather my information and populate labels as a test.  However, that caused an error.  This is the code I currently have to use.

foreach (GridViewRow gvr in GridView1.Rows)
                if (((CheckBox)gvr.FindControl("CheckBox1")).Checked)

                    lblTest.Text = gvr.Cells[1].Text;

Is there any advice anyone could suggest to gather multiple values and populate other labels? the other labels are labeled accordingly as lblTest2 and lblTest3. I currently am gathering my data from a gridview and only want to pull the StaffID from gvr.Cells[1].text.  Any help would b

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


Security Briefs: Access Control List Editing in .NET


Access control lists (ACLs) can be complex beasts, and user interfaces for editing them are incredibly tricky to implement properly. That's why I was really excited when Windows® 2000 shipped with a programmable ACL editor, shown in Figure 1.

Keith Brown

MSDN Magazine March 2005

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

Getting user control in NewForm.aspx of the list


I have designed a user control where i have placed some custom fields as per my requirement now my next step is as soon as user clicks 'Create' under Site Settings it should take him to my user control page instead of Newform.aspx default page of the list.Just let me know your suggestions to achieve this as it would help me a lot

Thanks & Regards,


how to get the text of selected checkbox from asp.net checkboxlist control using jquery


I have asp.net checkboxlist control that bounded to a data source so the number of items in the control are different from one to to another time.

I have this function:

     $('#<%=chkListGroups.ClientID %> input:checkbox:checked').siblings('label').text();

this function will return all texts for all selected items in the control as a one string.

 I'm looking for a way that when I check a check box from the ckeckboxlist control will return only last checked checkbox.

this code :

$('#<%=chkListGroups.ClientID %> input:checkbox:checked').last().siblings('label').text(); 

returns last checked item for example if I checked second will return
second item then when I checked fifth item will return fifth item but
if now when I check third item will return fifth item so it is always
returning last item checked in the list and I'm looking to

Please advice me how to do this using jquery.

Has anyone experienced problems using a reorder list control in Chrome/Firefox?


I have three reorder lists on a page, one does not want to work. It is no different to the others, but is behaving like it is not enabled.

All working fine in IE 7 + 8.

Any ideas appreciated :)

User control with multiple item content

I have a user control that I would like to contain multiple items as its content, similar to the way a <StackPanel> works. I tried using a <ContentPresent/> but it will only let me use a single item as the control's content. What's the best way to go about this? I realize I could just require the user to put a <StackPanel> or <Grid> or similar control as the content of the user control, but i would rather not do that if possible.   I'm not sure if it matters, but this control actually has several content presenters. Some of them will contain a single item and some will contain multiple items.

does SPD support filtering of the mail title/body we send to a list/library?

for example, if we send a mail with the title of "%hostname% %ipaddress%" to a list. can SPD WF filter the title and get %hostname% to a new variable? the reason to ask this is i want to send a well-formated mail to sharepoint and the automatical WF can recognize the change of the list items and update the relevant columns by the filtered content from mail title or body. thanks!

Reorder list problem having to do with control placement

I have a page with a FileUpload control that uploads an image to a sql db when Button_Upload is clicked. I also have a reorder list contained within an update panel to display all the images in the database.The problem is with the code as shown below:1. I have the Button_Upload as an AsynchPostbackTrigger for the Update Panel2. The FileUpload.PostedFile=Nothing in Button_Upload_Click and no new image gets loaded.If I remove Button_Upload as an AsynchPostbackTrigger as a trigger then1. image gets added but reorderlist doesn't get refreshed and new picture doesn't appear in reorder list2. if I manually refresh browser button click event fires and image gets added againWhat is the way to place controls/triggers to get reorder list to show new picture when it gets added to the database? Thanks   <%@ Page Title="" Language="VB" MasterPageFile="~/sfcas_nofooter.master" AutoEventWireup="false" CodeFile="ImageUpload.aspx.vb" Inherits="ImageUpload" MaintainScrollPositionOnPostback="true" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div id='leftside_fixproblem' &g
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend