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

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

How to Add A Scroll bar to ChecKbox List

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Can any1 guide me to add scrollbar to checkboxlist Regards Chandrakant 

View Complete Post

More Related Resource Links

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

checkbox list help!!!

How can   I make the following code shorter and more efficient.  Goal:  I want to loop through the check box list for all true values.   I want to get the check list item and complare with database value then check the box.                For Each xList As ListItem In cblGroupDiningOptions.Items                        If xList.Text = "Meals_List" Then                            If eContentItems.Meals_List = True Then                                xList.Selected = True                           End If                        End If                 &n

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">

Filtering with Multiple selections (Checkbox list control)

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?

using a checkbox list and Table Valued Parameters


I have a checkboxlist that gets all all the items from a look up table. The user is going to go to the list, check certail items and insert the checkboxid, the value (0 or 1),  and the userid  into a table valued paramater using a stored procedure. I have the user defined table type created but thats about it. Any body out there have any hints.

List box source updated, scroll into view



I have a list box with only item (a Image), its an observable collection , and that gets updated very often,

But if the previous source  was scrolled to the bottom,

 the new source is  also scrolled to the bottom,I want the new source to  scroll to the top evey time its changed

Ive tried scrollToview(currentItem) etc but  it doesnt seem to work

  ItemListForSlides bariatric_slides = new ItemListForSlides(bariatric, 1); // an observable collection

            if (ListBoxS != null)
                itemisdelcted = true;
                ListBoxS .ItemsSource = null;
                ListBoxS .ItemsSource = bariatric_slides;
                ListBoxS .Visibility = Visibility.Hidden;

update dynamic checkbox list


Hi there .. on page load I fill a repeater with checkboxes. I use a separate tablelist (subcatID & userID) to check if chkbox is checked or not.

On pageload and works fine (according boxes are checked):

For i = 0 To rptFavorites.Items.Count - 1
                Dim subcatID As Label = DirectCast(rptFavorites.Items(i).FindControl("lblSubcatID"), Label)
                Dim available As Label = DirectCast(rptFavorites.Items(i).FindControl("lblAvailable"), Label)
                Dim chksubcat As CheckBox = DirectCast(rptFavorites.Items(i).FindControl("chkSubcat"), CheckBox)

                Dim conn3 As New SqlConnection(ConfigurationManager.ConnectionStrings("VCConnString").ConnectionString)
                Dim cmd3 As New Data.SqlClient.SqlCommand("Select * From tbl_interest where userID=@userID and subcategory=@subcategory", conn3)
                cmd3.Parameters.AddWithValue("@userID", "28")
                cmd3.Parameters.AddWithValue("@subcategory", subcatID.Text)
                Dim myReader3 As Data.SqlClient.SqlDataReader
                myReader3 = cmd3.ExecuteReader()
                If myReader3.Read() Then
                    chksubcat.Checked = True
                    available.Text = "Y"

MVC2 Convention for Many-to-Many Relationship and Checkbox List?


I have a many-to-many relationship in my database (and Entity Framework Model) as follows:


Can anyone tell me the convention for creating a list of checkboxes for Data Admin that my users can select to fill the USER_DATA_ADMIN table?

(kind of new to MVC2)


Client-side checkbox list validator?


I've looked at these:



but these both work server-side (unless I'm missing something). I had hopes for the second one because it embeds javascript.

I have other validators on the page, and I want to show everything at once.  But the other ones are client-side, while the two I tried don't show the error message until the page posts back.

How do I store a list of checkbox choices in the DB most efficiently?


I'm not expecting a full solution here (unless you really want to), just some tips and pointers.

I have a User table and an Area table. The User table has userID, userName etc., and the Area table has areaID, areaName etc.
I'm binding the list of Areas to a checkboxlist where the user MUST choose between 1-3 options. I'm using a stored procedure to update the DB.

Is there a common solution to this problem that I haven't found?

I have thought about saving it as a comma separated string in a field in the user table. This looks like a temporary and ugly solution though, do you think?

A nicer solution would be to create a UserArea table where I save the ID's as foreign keys from areaID and userID. But I don't know how to write this stored procedure where I update and insert the choices made.
This way would also help me when I need to get statistics, plus it's moer scalable, I think.

Any help is greatly appreciated!


accessing checkbox list from with in edit item template.


Protected Sub dsEmployeesByDepartments_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting
        'Determine which checkboxes have been checked
        Dim selectedDepartmentIDs As New List(Of String)
        For Each li As ListItem In CategoryList.Items
            If li.Selected Then

How to create a dynamic list of checkbox controls in Infopath


I am relatively new to sharepoint, and since I do not yet have a proper development environment in my current contract, I have had to attempt to produce solutions to various line of business problems using Nintex and Infopath alone.  They are working on getting one created for me but i still can't believe microsoft make you purchase a whole other sharepoint server licence unless you think developing directly on the live server is a good idea, but I digress, thats not the issue I need assistance with.

The current issue I am trying to find a solution for, or atleast the right way to approach, is the creation of a simple form where the user can check off a register of daily tasks completed and submit the form back to sharepoint from a tablet PC.  Each submission is to create a new entry in the DailyRegister list with a handful of other fields like who, where, when, etc.

That is the easy part that I was able to produce with relative ease, but where it gets tricky is they want the list of tasks to be dynamic. 

i.e. A separate sharepoint list that will just hold the list of currently relevant tasks to be included in the form for that day.  Effectively using a 3rd list as the relational reference table between the DailyRegister list and the AvailableTasks list.

I am planning to create the AvailableTasks list to look something like:

how to compare to check box list and show selected in first checkbox list


how to show first check box chkched which in show in second check box list

 <table> <tr> <td> <b>Author</b> </td> <td> <b>Reader</b> </td> </tr> <tr> <td> <div style="BORDER: thin solid; OVERFLOW: auto; WIDTH: 200px; HEIGHT:200px"> <table id="Chklist_Author" border="0"> <tr> <td><input id="Chklist_Author_0" type="checkbox" name="Chklist_Author$0" /><label for="Chklist_Author_0">Select</label></td> </tr><tr> <td><input id="Chklist_Author_1" type="checkbox" name="Chklist_Author$1" /><label for="Chklist_Author_1">1029.Aarti</label></td> </tr><tr> <td><input id="Chklist_Author_2" type="checkbox" name="Chklist_Author$2" /><label for="Chklist_Author_2">1025.Akash

checkbox list ,requried field validator


I have code

<div id="list" class="right_txt_space_accm">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<td  align="left"><strong></strong>
                                                    <asp:CheckBoxList ValidationGroup="testGroup" RepeatColumns=3 RepeatDirection=Horizontal ID="CheckBoxList1" runat="server">
                                                        <asp:ListItem Value="1">Cutomer Broker</asp:ListItem>
                                                        <asp:ListItem Value="2">N.V.O.C.C</asp:ListItem>
                                                        <asp:ListItem Value="3">Hauloiers</asp:ListItem>
                                                        <asp:ListItem Value="4">Air Freight</asp:ListItem>
                                                        <asp:ListItem Value="5">Sea Freight</asp:ListItem>
                                                        <asp:ListItem Value="6">Supply Chain Management</asp:ListItem>

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

How to Fix the Header in DVWP if list has scroll bar



I have one List added another list on the display page of first list and set the webpart hieght in appreance section of Data View Properties of ModifyWebPart of List.

If i scroll the item in list it scroll up the header also.

Please suggest, If i scroll the scroll bar then header should be fixed .

Checkbox list issues


Hi Experts,

I have a project table in SQL server. For each project in the table I need to generate a checkbox. So I'm dynamically generating check boxes as follows.Checkbox list is inside a panel called "pnlProject".


void fillProjects()
        DBConnect db = new DBConnect();
        DataSet ds = new DataSet();
        ds = db.getDataForgrid("SELECT project_id,project_name FROM project order BY project_name ");
        DataTable dt = ds.Tables[0];
        CheckBox chkAll = new CheckBox();
        chkAll.ID = "ChkSelectAllProject";
        chkAll.Text = "Check All";
        chkAll.Font.Italic = true;
        chkAll.Font.Bold = false;
        chkAll.AutoPostBack = true;
        chkAll.CheckedChanged += new EventHandler(chkAllProjects_CheckedChanged);
        CheckBoxList chkBox = new CheckBoxList();
        chkBox.Font.Bold = false;
        foreach (DataRow r in dt.Rows)
            string msg = r["project_name"].ToString(); 
            chkBox.Items.Add(new ListItem(msg, msg));


I have 3 questions.

1) There is a "Select All" check box in the Checkbox list. If the user selects the "Select All" I need to check all the check boxes in the list. How

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