473,804 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checkBoxField on gridView

I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Column s.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.
Dec 21 '05 #1
3 10344
There are many essential information that you have not provided:
1- Is your GridView built dynamically or declartively?
2- If your GridView is placed declaratively, why not add an
<asp:CheckBoxFi eld >?
3- In which event did you place the code that you posted below?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Brad" wrote:
I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Column s.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.

Dec 21 '05 #2
Phllip,

Thanks for the information. I was building the GridView dynamically (kind
of the old fashioned way with a declared SQL data adapter and dataset, etc).

I now am using a checkBoxList which is currently working exactly the way
that I need. For this instance, I think a gridView was a bit of an overkill
possibly.

I actually prefer building the GridViews dynamically as then I feel that I
have more control over them. But I do use SQLDataAdapter when I am building
a simpel gridView.

Thanks again.

"Phillip Williams" wrote:
There are many essential information that you have not provided:
1- Is your GridView built dynamically or declartively?
2- If your GridView is placed declaratively, why not add an
<asp:CheckBoxFi eld >?
3- In which event did you place the code that you posted below?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Brad" wrote:
I am programatically trying to add a checkBox column to a gridView.

This is what I have to do it (VB):
Dim cbCol As New CheckBoxField
cbCol.Text = "Enter this event"
gvEvents.Column s.Add(cbCol)

When it displays the column, there are no checkboxes.

Maybe I am going about this the wrong way. What I am trying to do is to
present the user with a list of no more than a dozen choices (dates of events
that they can enter). The user should be able to select anywhere from one to
all of the records and I would like to have a check box column to do this.

If a gridView is not a good choice, then should I maybe do a listbox?

Thanks for the information.

Dec 21 '05 #3
Hello

Refer 4GuysFromRolla. com or DataGridGirl.co m and find article to add
check box column in data grid.

I think this will help you better.

B

Dec 22 '05 #4

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

Similar topics

6
3044
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the current_row_key of Grid1... to the objectDataSource2 parameter? (so that the second grid, gets only the information to do with current row of grid1)
3
1267
by: mike.aes | last post by:
(ASP.net 2.0) I am using a Gridview control that is bound to a table in my SQL database. For some reason, when the Checkbox is clicked, it stores a 1 (Positive 1) in the bound field instead of a -1 (Negative 1). Any ideas what's going on?
2
7226
by: hazz | last post by:
Given the update query UPDATE Columns SET Include_in_Report = @Include_in_Report WHERE (ID = @Original_ID); Include_In_Report is a bit field in the table, represented as a checkbox on the grid. If someone clicks on the checkbox, I would like the bit field in that row in the database table to be updated immediately. I don't want to have to first
1
2574
by: graphicsxp | last post by:
Hi, I have a checkboxfield in my gridview: <asp:CheckBoxField DataField="Analysed" HeaderText ="Analysed"> <ItemStyle width="20px" /> </asp:CheckBoxField> How can I reference the field from my code-behind ? I can't see any properties/methods on the grid to access it. There's no ID so I can't do FindControl :(
0
1149
by: dwg1011 | last post by:
I have a detailview with several fields ending with the CheckBoxField shown below: <asp:CheckBoxField DataField="aruExtraFields" HeaderText="Extra Fields?" ReadOnly="false" SortExpression="aruExtraFields" /> </Fields> </asp:DetailsView>
1
4747
by: spitapps | last post by:
I have a gridview declaratively added to my webform. This gridview displays data from a stored procedure returned as a dataset. Once the dataset has been modified slightly i bind it to my gridview control. Now where and how would i go about adding a column to my gridview dynamically that is a checkboxfield and is checked based on some criteria i want to use. An example... if...
0
1669
by: Gustavo Ringel | last post by:
Hi, I'm trying to get the checked/unchecked of a Gridview CheckBoxField in code. I tried to cast the row cell to a CheckBoxField and it doesn't compiles. I'm also able to get the Text of the CheckBoxField but not the value... Any ideas? Gustavo.
0
2413
by: Jason Huang | last post by:
Hi, How do I bind data to a GridView in my C#.Net 2.0? Given that in the GridView1 I have 3 BoundFields and 1 CheckBoxField. I can bind the DataSet to the 3 BoundFields if there's no CheckBoxField, but if with the CheckBoxField, i don't know how to bind just the 3 BoundFields. Thanks for help.
0
1628
by: Slickuser | last post by:
I want to implement a GridView that displays all records in the database & which contain CheckBoxField (true,false). Whenever this form is displayed, the user can be able to change the status of that CheckBoxField for each record. The CheckBoxField in GridView but is not editable. Any idea how I can fix this? Thanks.
0
9708
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
10588
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
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
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
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
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
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
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.