473,849 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: Using Multiple Checkboxes or Checkboxlist to filter results in a gridview in ASP.NET 2.0 / VS2005

Hello, and Thanks in advance for any light you might shed on my
troubles.

I'm trying to setup a series of checkboxes, or a checkboxlist to
control the results that are shown on a gridview control.

I have a column in my database that hold the current status of the
items in there. If I used a checkboxlist and populate it with my
options, and set the SQL statement on my gridview control to:
"SELECT [DB_ID], [P_Name], [Status], [Stamp] FROM [Patches] WHERE
([Status] = @Status) ORDER BY [Stamp] DESC"

@Status is my checkboxlist control.

It only partially works, if I select only one checkbox, it updates the
page correctly, if I select more than one, only the first one selected
gets shown and the rest are ignored.

I've also tried setting up 5 individual checkbox controls, and changing
my SQL to:
"SELECT [DB_ID], [P_Name], [Status], [Stamp] FROM [Patches] WHERE
Status IN (@Param1, @Param2, @Param3, @Param4, @Param5 ) ORDER BY
[Stamp] DESC"
I've set ConvertEmptyStr ingToNull on all of these Param's to True and
False. When using the default PropertyName for the Paramater of
Checkbox.checke d, I get this error.
"Syntax error converting the varchar value 'mystring' to a column of
data type bit." (I understand why, now, just including what I've done
already)

If I use checkbox.text for the Parameter, it's always active since the
..text property doesn't change dynamically with it being checked or not.
Basically, I have a page that I want users to be able to filter how
much of the page they see by selecting 1 more more checkboxes. Any
suggestions on how I can get this filter up and going?

Dec 29 '05 #1
0 1997

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3202
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the user clicks on a certain button on the page, which is not in the grid, I want to be able to traverse through all the checkboxes in that column and see how many are checked. This is so that I can give them a confirmation dialog before I do an action...
2
1445
by: John Hoge | last post by:
I'm looking for that elusive .net time saving magic. I have an application that presents a list of items which the user can select from. A CheckBoxList works great for that, but I want to query a database based on their selections. I'm forced to dynamically building a SQL statement in a method I could have done easily in classic ASP: SELECT fields FROM tablename WHERE ID IN (value1,value2....)
1
1096
by: SalamElias | last post by:
When I add checkboxes dynamically, I can set several attributes(id, eventhandlers specific to checkboxes....) in code. I decided to use the checkboxlist to generate several checkboxes dynamically instead of looping and writing a lot of code 1st question :How can I give each checkbox an identity from the datasource and an eventhandler for one of a checkbox's events in code. for example CheckBoxList doesn't have "CheckedChanged" event...
0
2413
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
0
2753
by: joebob8000 | last post by:
This seems like a simple task, but my 6 year old roots in classic ASP must be causing me trouble with my current problem. I am looking to provide a search for users in which they can select multiple categores (check boxes) and view only the results in those categories in a gridView control. My goal is to do so for movies, so an example would be if the user checks comedy and childrens then they would only get childrens comedies and the...
0
5580
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
3522
by: mutt1170 | last post by:
I have a checkbox list nested inside a gridview. The gridview pulls its data from an objectdatasource and lists countries. The nested checkbox list is databound to another object datasource and lists the regions for each country. The checkboxlist has autopostback set to true and I want to perform an action based on whether or not each checkbox is selected. I am having trouble retrieving the nested checkboxlist to access the selected...
0
1646
by: Ned Balzer | last post by:
Hi, Can anyone point me in the direction of a solution for validating multiple checkboxes in an asp.net 2.0 page? 1) This is not a checkboxlist, it is a number of separate checkboxes 2) I do not need to ensure that they are checked, what I am trying to do is lock down the page to prevent possible code injection. So, the checkboxes can be either checked or unchecked, I don't care.
3
2763
by: santoshjsh | last post by:
hello everyone, i have a gridview in which i have multiple checkboxes in a single column. means for every row in the gridview i have four checkboxes in one column e.g Add, Delete, Print, Modify. now i need to bind these check boxes from database table according to the four different fields in the table in which the value is 0 and 1. if the column value is 1 than the checkbox should be displayed checked otherwise no. i dont know how...
0
9893
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11005
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10665
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10723
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7894
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7070
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.